I´m working on my own smart home system using some arduinos and Xbees, receiving them on a raspberry pi / mac os X with node.js via serial line connected xbee.
I was thinking about a small simulation so that i can develop without need of running hardware. The only way i know to simulate a serial line is using named pipes which would need two files, one for the input and one for the output. This would need heavy changes within my node.js code (using xbee-api module) which i would like to avoid.
Does anyone know another way to simulate a serial line communication without splitting the communication into two files? My aim would be to simply change the name for the serial port in the configuration of my main code which should than send and receive frames.
I now decided to write my own simulator because there seems to be no other solution. I work corrently on a simulation of the serialport module for nodejs.
Related
I'm making a project for my class, and it will be demonstrated within an area with no access to the internet.
What I want to do is calculate a number from one Raspberry Pi and send that variable wirelessly to my second Raspberry Pi that is connected to my Arduino via serial communication and perform the demonstration. I have Serial Communication working well within Node Red, but I'm trying to see if this is feasible or if there is a better way of sending of variables just in case I do need the internet. I heard of using MQTT but I don't know if that's the best choice.
Also, if I do need internet connection for MQTT and it will not work, what is a good node to use for bluetooth communication between two Raspberry Pis if that's more viable.
folks.
I'm writing some sort of scheduler that will send commands and receive responses to a hardware controller that is connected to the Linux-based system via a serial (UART) port. Currently it is FT232RL USB <-> UART bridge.
The scheduler itself is asynchronous and written using asyncio "in-code" Python module. There is no code that may block main loop. But here I'm facing the need of actually sending data to the controller via UART and receiving data from it. The "controller" will actually execute commands and perform actions with physical devices. The problem is that there is no "in core" standard Python module to communicate with external devices using serial ports. Especially the way asyncio does.
Is there is any actual maintained one that is supported by Python 3.10 that will allow me to make use of asyncio and make non-blocking data transmission via UART?
The pyserial-asyncio seems to be a good candidate. Any other modules to take a look at?
I am able to use bleak and get data from all 5 BLE sensors. But the problem is that I am unable to identify which data is from which device. I mean i need a string representing the address of the device alongwith the data itself.
I was able to get data simultaneously from all the BLE modules using bleak in Windows, as well as on raspberry pi.
The only problem with Windows is that if you use Bluetooth 4.2 adapter & above. It will be much better for the high speed data rate, and proper devices connection handling. As with the 4.0 adapter, I have always gone through one or two exceptions each time i started the script, and the maximum number of connections I got was 3.
When i tried this script on Raspberry pi 3b+, it has on-board chip of Bluetooth 4.2. It was able to give high speed data rate, and my 5 sensors were connected to it simultaneously.
Also, The two_devices examples in bleak source code on Github, is very good example for starting with further coding.
And if you run the script and found the data on console, but you were unable to get that which data is from device. Then you need to use functools, (what it does is it will inject the client you're connected to at present, with the callback function, and it will make the work much easier).
Check this out on Github: https://github.com/hbldh/bleak/issues/601
So I have my computer linked up via bluetooth to two different devices, and I'd like to relay the input from one device to the other device automatically.
I figure I can do this with a script, but I'm pretty green with scripting languages, and I'm not even sure if this is possible.
I know that like Linux, OSX treats serial ports as if they were file directories, so I figure this can't be too hard. I just have no idea where to start.
Can someone point me in the right direction?
I would use a simple python script. Manipulating serial ports is simple with the pyserial module. Then create thread for each port that reads from one port and writes to the other.
I am trying to use scilab for a project and I need to pass on some values to a robot via a serial port.
I had done this successfully on Matlab. I have ported almost everything to Scilab now but I don't know how to pass those parameter through serial port.
On the Sclilab site there are some modules, but they only work under Windows
http://atoms.scilab.org/
I am the maintainer for the Serial Communication toolbox in Scilab. This works on Linux as well. You can find it here: http://atoms.scilab.org/toolboxes/serial. This is fairly easy to use- it has functions to establish communication with the serial port, to read from and write to the serial port, and to terminate communication with the serial port. Please let me know about any feedback or questions you may have. Thanks.