AppConnectorExample: nothing happens [solved]

Forum for software developers to discuss BCI2000 software development
Locked
pieterkubben
Posts: 22
Joined: 23 Jan 2012, 07:18

AppConnectorExample: nothing happens [solved]

Post by pieterkubben » 12 Jun 2012, 23:04

Hi,

I do not know if I am doing anything wrong here, but I have successfully downloaded and compiled the AppConnectorExample using Qt 4.8.1 on Windows 7 (64-bit), and chosen several ports for the localhost (5000, but also the default settings). When I click on the Connect button, I get the result as shown in the attachment, and that't it. No values appear in the fields below.

I used BCI2000 launcher for starting a BCI session: initially with Emotiv (signal source), DummySignalProcessing, DummyApplication. Afterwards tried with some other parameters, as well as P300 batch file with signal generator.

The goal is to send output (key commands) to an application that controls a robot arm. When reading the documentation for the KeyStrokeFilter I got the impression that I could use this or the AppConnector as described in the technical reference.

Have not been able to figure out how to get the KeyStrokeFilter to work, and if I can do it with the AppConnector, that may be even better. What am I doing wrong? Do I need to use a different setup as the ones I have tried?

Thanks for any suggestion,

Pieter
Attachments
AppConnector's fields remaining empty
AppConnector's fields remaining empty
AppConnector.png (18.75 KiB) Viewed 2265 times
Last edited by pieterkubben on 13 Jun 2012, 18:32, edited 1 time in total.

mellinger
Posts: 1064
Joined: 12 Feb 2003, 11:06

Re: AppConnectorExample: nothing happens

Post by mellinger » 13 Jun 2012, 06:18

Hi,

you need to set the ConnectorOutputAddress and ConnectorInputAddress parameters to the desired ports. Also, you cannot use the same UDP port for input and output.

The wording in the AppConnectorExample GUI was somewhat misleading (it has now been corrected). The AppConnector protocol uses UDP, which does not have "connections". Rather, one opens a port for reading or writing, without knowing who is reading or sending data at the other end, or whether there is someone at the other end at all. Thus, the AppConnectorExample cannot give an error message on misconfiguration. It will just not display anything when no data is sent from BCI2000.

Regards,
Juergen

pieterkubben
Posts: 22
Joined: 23 Jan 2012, 07:18

Re: AppConnectorExample: nothing happens

Post by pieterkubben » 13 Jun 2012, 16:58

mellinger wrote:you need to set the ConnectorOutputAddress and ConnectorInputAddress parameters to the desired ports. Also, you cannot use the same UDP port for input and output.
:oops: Is there a hole in the ground I can jump in to? Just did not see (or think of) this tab in the config panel. Now it works.

Although I hade to make another (stupid?) mistake first: found out that the ConnectorOutputAddress in BCI2000 correlates with the Input IP:Port of the AppConnectorExample. Although it makes perfect sense, my first guess was to use it the other way around... Maybe that is something for the documentation, maybe that is just me... ;-)

Now continuing with the C++ code example in the technical reference. Having some issues, but will try some things first.

Thanks,
Pieter

pieterkubben
Posts: 22
Joined: 23 Jan 2012, 07:18

LNK2019 unresolved external symbol

Post by pieterkubben » 13 Jun 2012, 18:31

Okay, it is working now. Here is some useful information for people who are working in Qt Creator (maybe also in MSVC) and who are encountering a compiler error message "LNK2019 unresolved external symbol" after they create a new Win32 C++ console project and have added the SockStream.h/.cpp files in their project folder.

In your project's .pro file you have to add this code:

Code: Select all

win32 {
    LIBS += -lwsock32
}
The compiler goes crazy if you leave this out, but if you copy & paste the whole section of the AppConnectorExample:

Code: Select all

win32 {
    SUBDIRS = 
    CONFIG += windows
    LIBS += -lwsock32
}
it did not work for me using the MSVC compiler. And although it did compile using MinGW, it did not work.

The SUBDIRS line can be deleted without problems, but the CONFIG line was the one that was causing me problems. Don't understand why, but after deleting it (and using the first code snippet) it worked without problems.

Pieter

Locked

Who is online

Users browsing this forum: No registered users and 1 guest