Expose BLE via Socket #78
Replies: 3 comments 6 replies
-
This is possible with socat -dd open:/tmp/ttyBLE tcp-l:4001
Now you can connect to it from your application. Or socat is also very flexible, for example: socat -dd tcp:$RPI_IP:4001 pty,rawer,link=/tmp/ttyTCP # tcp client back to pseudo serial terminal
socat -dd tcp:$RPI_IP:4001 - # tcp client to stdin/stdout The functionality could be also quite easily integrated into ble-serial, in the current architecture it would add a tcp server module and hook it up instead of the serial port emulation. Then it would be just a arg like Security is also to consider though, this is plain TCP without encryption or authentication. Don't know, your BMS also allows changing settings over this port? I would only run this on a separate local network, where nothing else can reach it. Otherwise large misconfigured batteries can be quite dangerous. |
Beta Was this translation helpful? Give feedback.
-
Great. I will give this a shot. I'd like to use it in a "closed" network where I have multiple battery banks that are not all within BLE range of the server, but I do have WiFi access. Adding in a small Pi Zero W to convert from BLE to serial and then serial to TCP/IP might help. (bypassing serial all together would be even better). I'm not as much worried about the security, but it could be a concern for others. However, most people don't bother to change the "PIN" from the default on the BMS, and even that the PIN can be bypassed. Roy |
Beta Was this translation helpful? Give feedback.
-
So, this works great but with a few "quirks".
Linux is not a "native" OS for me so I don't know a lot of the "tricks" to use. |
Beta Was this translation helpful? Give feedback.
-
This is great that I can now access the BLE communications via a standard serial port connection. I'm using this on a Pi that talks to multiple BMS devices.
What would be nice is if it could also be exposed via a standard TCP/IP socket connection. Then I could setup a single Pi Zero that is connected to the network exposing all my BMS connections, and then form a central application I could just open up a socket to the correct port and read/write to it.
Beta Was this translation helpful? Give feedback.
All reactions