github.com / OpenBCI_Python
Sorry if there is already a question on this, I didn't see one, thus...
After attempting to run the Python code user.py (which has now been updated and runs a little better, thank you), I get an error about not being able to stream data because there is no SD card installed. Indeed, I was hoping to just stream the data into my computer and process from there without needed an SD card on the board. Is an SD card required to even stream data to the dongle and out of the serial port of my computer?
Seems odd to me.
-Cere
Comments
You should definitely not need an SD card to stream. Which board are you using? Do you get the same error when running test.py? (also in github)
I'm literally getting on a plane right now but in 24 hours I'll be available again.
Bests,
Rodrigo
Also try giving the board more time to initialize. After connecting the board, it should output how much free ram it has. Try hitting enter on the prompt until you get that info and then send some commands. There are some delays in the code ment to give the board time, but perhaps they are not enough.
You are right, the code should NOT be calling any processing code at all. I'll look into this when I arrive.
Bests from Lima airport!
Rodrigo
I think I know what the SD error was. The latest commit for the user.py has a start command (-->/start) not (-->start) . The reason is that I enabled the command line to take multiple characters as arguments so that you could make commands like (-->x3020000X).
I'm really sorry I didn't catch that from code. I was responding on my phone and it was a mess.
The reamme does say you should use /start.
Something I have found while working with the boards is that the order of connecting and turning them on is sometimes important. Try powering everything off and first connecting the dongle, a blue light (D6) should light up and stay lit on the dongle board. If it isn't, disconnect and re-connect. Then turn on the board.
The blinking TXD lights probably means it is transmitting. Are you sure you are using the latest code in the repo? It looks like you might be running a test version that runs csv_collect.py. In that case, a collect.csv file should have been generated with the data coming from the board.
So to summarize: Make sure you are using the latest version of the code. Try connecting the board in the way I described above. Then run the code using "-->/start".
Let me know if any of that works.
And again, sorry about missing the start command prompt error.
I'm not a python guru myself but so far I've been managing the python scripts for Open_BCI. I'm sorry I haven't managed the pull requests yet. I've been involved in another project but will get back into this tomorrow.
You're right to point out the fragmentation problem, this is my first time managing github repos and any advice is definitely welcome!
Yes, a python driver would definitely be a goal to work towards.
As to the organization of such code, well that's the question right hahaha. The way I was thinking this could work is to have a main open_bci.py script that's lightweight and dedicated to managing the serial connection with the board. Because of the callback architecture, people can then create scripts and functions like you have done that can be added to the repo. Eventually, we could make a proper library that collects all these scripts into a coherent block, but I don't know if the code is mature enough to do that right now.
Please don't hesitate to contact me regarding any questions or ideas you might have!
I'm sure you can you ask python to import all files in a directory with a relative path? But then how would you make the code understand user commands to execute its functions? It would have to generate names for all the function it imported and keep track of what module had which functions, so that one a user types /my_function it correctly sets the callback function to my_function. Then, what if those functions require arguments themselves. How would we pass them down? Have you done anything of the sort?
It seems like having people use the python interpreter would have almost the same results. People could import their libraries, make an open_bci object and then give it their function to execute with any arguments that it needs.
I also like your rate function a lot, and was thinking that since it's a really important aspect of the communication, we could incorporate it into the open_bci_v3 main code. There, it would be very easy to time arriving packets and keep an updated transmission rate that could be accessed by outside functions. What do you think about this?
I didn't have my daisy module at work with me so give me a few days to get it so I can run the 16 channel code you wrote.
First time I've heard of yapsy, and it looks great. Can't wait to try it out.
This is so simple! Awesome work.
The Node code is a joint project with a couple of webdevs that should soon begin to work on their end of things, but also long as the server works and sends the packets as jsons it shouldn't matter. I'll make it into a plugin as soon as I get a chance.