Sending commands from Android to Cyton via Dongle

KrisGKrisG United Kingdom
edited June 2019 in Cyton
Hi guys, 

first off thanks for all your work and wonderful products!!! :)

I've trying to send some commands from and android, dongle and then to get data streaming from the Cyton. I've managed to get a few commands to feedback to me '~~' returns the Hz (250). However, other commands like 'd' are not returning anything, Most importantly, I am not getting any data from writing the command 'b', even after turning on channels and manipulating the channel settings through using commands like 'x3020000X'. What commands should I be sending to get data back, I've been following the documentation with little luck?

Kindest regards, 
Kris

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Kris, can you clarify?

    You are using an Android with a USB host mode (OTG) adapter, so the Cyton dongle is plugged into the Android? At that point the Cyton should appear as an Android serial port.

    Some Android devices don't have full support (or buggy support) for OTG.

    Regards,

    William

  • KrisGKrisG United Kingdom
    Thanks William, 

    I'm using Android's to communicate with the Cyton through the Cyton dongle which remains plugged into the Android usb. I'm utilising the 'com.github.felHR85:UsbSerial:6.0.6' library to support communicating with the device via serial usb. 
    My application has been able to communicate with the Cyton. I have gotten responses from the device including: 
    - "~~" which returns the rate of Hz
    - "0" which returns confirmation of the test of the signal
    - additionally I receive the message that the Ganglion sends out when it is turned on. 
    There are a number of commands that have no effect:
    - 'b'
    - 'd'
    - setting channels
    - turning on/off channel makes no difference.

    I've also been testing this on multiple phones, the same issue is occurring. 

    Is there a set of commands that I should be sending to start EEG data collection, beyond 'b'?

    I've been trying to understand what commands the Open_BCI_GUI but this has been something of a challenge of understanding exactly what order of the commands are being sent. 
    Thanks in advance,
    Kris
  • wjcroftwjcroft Mount Shasta, CA
    Kris, hi.

    So this is the Github repo you are using,


    And searching that repo for FTDI, I get,


    CHANGELOG shows several recent changes in improving FTDI operation in previous versions,


    My guess at this point is that the FTDI chip used in the dongle, may not be fully supported in this current 6.0.6 release you are using. As you know FTDI makes over a dozen different chips in serial port controllers. I have not checked the code further, but you might try checking it for references to the specific chip in the dongle: the FTDI FT231X.

    Another way you can debug the serial port connection, is to plug the dongle into a laptop, then use a serial port terminal emulator program, to send / receive serial data. The Arduino IDE can do this, there are numerous other emulators available, do a search. Be sure to set the baud rate correctly.

    Regards,

    William

  • wjcroftwjcroft Mount Shasta, CA
    https://www.ftdichip.com/Products/ICs/FT231X.html

    I'm not sure if the hardware level "handshaking" is turned on or off with the dongle. Try both ways.
  • KrisGKrisG United Kingdom
    Thanks William, 

    I worked through your suggestions and found the error. I hadn't set the 'stopbits'.
    I was just thought that I could supply a tutorial when I have a fully working application, is there somewhere that you'd appreciate it being posted?

    best,  Kris
  • wjcroftwjcroft Mount Shasta, CA
    Kris, thanks. Is your project on Github? Github has a wiki tab, where you can post arbitrary tutorials, text. Then post the link here. 

    Alternately you could upload any document to Google Drive and supply the link. Thanks much for doing this, others have asked in the past about interfacing through the OTG and dongle. You've actually done it!

    Regards,

    William

Sign In or Register to comment.