Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

integrate it with Bonsai using micropython and OSC #9

Open
amchagas opened this issue Jun 15, 2020 · 0 comments
Open

integrate it with Bonsai using micropython and OSC #9

amchagas opened this issue Jun 15, 2020 · 0 comments
Assignees

Comments

@amchagas
Copy link
Member

At the moment, for fast implementation and testing, we are writing code to integrate the ESP32 with Bonsai-RX. Bonsai is a powerful programming tool that runs only on windows at the moment, but it has integration with several pieces of hardware and software for neurosciences.

So making BeeHive compatible with Bonsai would make it "hit the ground running" in terms of usability and integration with other tools.

To do this we are leveraring the fact that Bonsai has an open sound control (OSC) module and that micropython also has an OSC library.

The OSC is a communication protocol that uses TCP/UDP to send packages over the network. This allows us to send information back and forward between ESP32 and the computer running Bonsai, but it also allows bonsai to communicate with several ESPs and for ESPs to communicate with each other.

right now a basic sketch of the code is on the software folder and it works in overall terms in the following way:

  • some of the digital ports are set to inputs, some to outputs.

  • some of the analog input ports are setup as well.

  • the ESP code loops through the digital input ports getting their state, and sends one OSC message containing one integer value that Bonsai will decode to know the state of the input ports.

  • ESP reads the state of the analog ports and sends out messages to Bonsai containing the state of each.

  • ESP listens to the income port for a specific amount of time, and if there are messages from Bonsai, turn the specific digital ports accordingly

@amchagas amchagas self-assigned this Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant