Getting data from wifi in raw format when it is set to json
Hello,
I am writing an app in javascript and I am trying to get data from cyton with a wifi shield.
I have a tcp socket server running, I send POST request with output set to json. The response contains connected: true and output: 'json' so it seems all is set up correctly.
Then I start the streaming and I am getting data as follows:

So it seem it is coming in the raw format.
Don't you know what should be done to get data in the JSON format? Thanks
cyton firmware: 3.1.2
wifi shield firmware: 2.0.4
Comments
@tomas_v
What are you using in Javascript to access the data? NodeJS Driver? Which one?
Please share the lines of code you are using or a link to the project.
Looking at this again, it looks like the data is already a JSON or Javascript Object .
@retiutut
Thanks for the reply. I am using it inside react native app, I create a tcp server and follow https://docs.openbci.com/docs/05ThirdParty/03-WiFiShield/WiFiAPI so I make just
fetchcalls. Then I log data from the tcp server. Yes, it is kind of a json but as it is mentioned in the manual, it should have the data split and timestamp added right? Also the typeBufferis quite strange and values are like byte values.Are you using one of the NodeJS drivers?
@retiutut
What do you mean exactly by the driver? I use openbci utilities to get the commands, but I am not using the openbci node sdk, because it has a lot of dependencies which are not compatible with react native
Can you please look at https://github.com/neurosity/eeg-pipes and see if this might work for what you are trying to do?
https://github.com/openbci-archive/OpenBCI_NodeJS_Wifi has been deprecated.
https://github.com/openbci-archive/OpenBCI_JavaScript_Utilities also deprecated.
While working on GUI v5, I found the following resource, which still seems relevant when using the WiFi shield:
https://app.swaggerhub.com/apis/pushtheworld/openbci-wifi-server/2.0.0#/
Can you work up a NodeJS code sample to try using TCP/UDP WiFi API? I messed around with the endpoints using Postman, but I wasn't able to view the data stream after connecting.
I checked eeg-pipes and it refers to the https://github.com/neurosity/openbci-observable for obci wifi shield. This one still uses https://github.com/openbci-archive/OpenBCI_NodeJS_Wifi under the hood (actually even the previous one).
I am actually using the TCP WIFI API. To set up connection I call
POST/tcpwith{ port: 4202, ip: '192.168.4.2', output: 'json', latency: 200000, }and the device replies with:
{"connected":true,"delimiter":false,"ip":"192.168.4.2","output":"json","port":4202,"latency":200000}And then I start the stream by calling
GET/stream/startThe log is from the tcp socker server. If I change
outputtoraw, the result is the same, that is strange.