I'm working on a project to control a drone using an EEG headset. The EEG headset is connected to my laptop [runnig ubuntu 18.04] and the drone to the raspberry pi [raspbian].
The code for processing the EEG data on the laptop as well as the code to control the drone is written on python 3.6 and work without any problems.
setup:
the EEG headset[ neurosky mindwave mobile 2] and the drone[ parrot mambo] both use BLE[bluetooth low energy] to connect with the devices. since both of them use Bluetooth it would be hard to send and receive data simultaneously to both the devices using a single code and laptop as they require a continuous uninterrupted connection and high data rates. hence the EEG headset is connected to the laptop via BLE and similarly the drone to the raspberry pi 3b+. The laptop takes care of processing the EEG signal and determining the desired command, while the raspberry pi acts as a wireless controller for the drone.
system setup
I need to pass the values between these 2 codes[and devices] so as to control the drone using the EEG signal. For eg, if I want to make the drone go forward after processing the signal I need to send say "1" or "f" to the raspberry pi from the laptop.
A wired connection such as Ethernet cable or USB is preferred over a wireless method.
The data size and rate is very less as a single character is sufficient and it will be sent only once every few seconds.
Which would be the best method to achieve this sort of communication
Use kafka or 0mq to loosely couple the laptop sender to the rasp pi receiver.
If one of them reboots, that's ok, the other will keep plugging away.
In the kafka case, you will enjoy the advantage of being able to replay a laptop publisher session again and again as you tweak and test the rasp pi client code.
Related
I am trying to record audio on raspberry pi zero and want to transfer the audio data in real time through Bluetooth (Classic or BLE) to an android application . I have created a GATT server referring to Bluez example code but given the amount of data(32-bit audio data, 16000 Hz). The process through BLE is really slow and i am not able to record and send the data simultaneously but one by one.
So i want to shift to Bluetooth Classic. What would be the preferable protocol where i can record and send the data along as soon as i receive it ? Are there Pybluez API which can allow me to achieve this?
I'm trying to connect several bluetooth devices with Raspberry PI to use them as speakers.
I'm using RetroPie as a distribution, because of the tests I've done it's the only one that matches and allows continuous synchronization with several bluetooth devices at the same time.
However, the system only detects the first device that connects as a sound card, the rest keep the bluetooth synchronization active, but it does not interpret them as audio cards even though it is indicated by blueman-manager.
Is there anything I can do to keep all devices synchronized and supported as audio cards?
Palm,
even so this a old post, it is not yet closed.
As I just got the same issue, here my answer.
What you try to do is to connect mutliple audio sreaming services (Speakers) to 1 audio bluetooth source, that is not possible like this. Therefore your PC only connects to the first box.
You could try multiple bluetooth dongles, but then you run into the timing issue with audio stream syncronization between the boxes.
The only solution is to use Bluetooth 4.1 upwards master-slave services.
Therefore the Speakers need to be connected to each other and seen as 1 device from the PC. In that mode the stream is skewed to ensure syncronous playing.
Many new Bluetooth speakers support this mode.
Hope that helped.
I am doing my master thesis and one of the important things for me is to transfer the recordings of pressure and temperature from a patient simulator to a PC. From the sensors, the information is taken by the raspberry pi3. I am using raspberry pi3 because it has inbuilt wifi option. Now I have to transfer the data from the raspberry pi to the PC wirelessly using python programming. I am new to python and I have absolutely no idea how to do this. Could anyone help me with writing the code so that I could at least send some data from where I could adjust the bit rate and other things according to my requirements?
Take a look at sockets, a simple client - server communication is really easy to do :)
https://wiki.python.org/moin/TcpCommunication
I have a 20 year old device that prints data through a 1994 HP Deskjet 550c printer using a parallel port. Now the printer is broken and so there's no way to view the device output. I was thinking of hooking the parallel port from the device to a Raspberry Pi 3 which will display the data on a computer screen. I can get a parallel to USB cable which connects the old device to the Raspberry Pi. When I press the print button on the device, data should be sent to the Pi, but what I'm worried about is the format of the data. Is there a standard protocol for print data, or does every printer manufacturer use their own protocol? Do you know of any open sourced python scripts that can directly parse the print data coming from the usb port? Do I need to install any drivers on the Pi?
I am new to this field, so this might be an odd question.
We can write a code(say blinking lights) in the aduino IDE and upload it to arduino and we can disconnect from the pc and the program will run. (blinking will happen).
Now when we are using cylon.js and write the program and execute say
$ node blinking.js
then as long as the arduino is connected to the pc(or laptop) the blinking happens and when I kill node js or disconnect arduino from pc the blinking stops. (this is how its suppose to happen, right?)
So my question is,
if I have a arduino with a temperature sensor some where outdoor and I have a cylon.js program to use those sensor data and do some things (say print them), then how can I achieve this ? Do I have to have two arduinos which are connected via wireless or gsm shields (one outdor and one connected to the pc where the cylon.js is running)?
or is there a simple way of doing this? Any insight on this is much appreciated.
Thank you
then as long as the arduino is connected to the pc(or laptop) the
blinking happens and when I kill node js or disconnect arduino from pc
the blinking stops. (this is how its suppose to happen, right?)
Correct. This is true for any Node.js program controlling an Arduino, whether with Cylon.js or Johnny-Five.
if I have a arduino with a temperature sensor some where outdoor and
I have a cylon.js program to use those sensor data and do some things
(say print them), then how can I achieve this ?
It's not possible with just an Arduino board. You can use a pair of Xbee modules, which will allow your Arduino to communicate with the host machine, or just use a board that has wifi or bluetooth capabilities, such as:
Spark Core
Electric Imp
Intel Galileo
Intel Edison
Raspberry Pi
BeagleBone
pcDuino