JohanWinas
Member since Sep 2020 • Last active Apr 2021Most recent activity
-
-
Yes it is always printing data to the console :-)
The module polls a device over a serial port, but I need to modify the code to not print any errors when I lift the TX pin on the device. Normally it would print an error every time it timeouts.
I have previously tried using the tx function in EspruinoHub to write data to a device via mqtt, I'm guessing that function will be effected by this to?? Never got it to work...
-
I just installed EspruinoHub on a Raspberry Pi 4 with node-red and an external BLE dongle with an external antenna. hciconfig shows the dongle ok.
The config for EspruinoHub points mqtt to a separate machine that only runs a mosquitto.
The web pages works fine, I can see advertisement etc etc. Ok.
Using an mqtt sub app I can see the /ble/# messages. Ok.
I start the webIDE, and it shows me the Espruino devices. Ok.
Click on a device and it connects and I can interact with the device. Ok.
Looking at the /ble/# topic on the mqtt server I get all devices messages before starting the webIDE, when the webIDE starts I only get the connected device messages. Ok.
I then click the disconnect icon, and the webIDE says disconnected :mac:. Ok.
But, looking att the /ble/# subscription I'm still getting the console messages from that device.
To get espruinoHub back to it's original state I need to stop and start it.
To me it looks like the disconnect is missed when the webIDE closes. -
-
- 5 comments
- 1,976 views
-
How did you sort out the CRC calculation??
Thats the only part that can be a bit tricky for a simple modbus implementation, I can build the packet by hand and parse the response my self.
I often get devices scattered all over the place that has a RS485 port with modbus, often its just a few bytes of data that I want from it. But running a hardwire etc etc to this makes it a lot of work. A small BLE device that polls data and sends it as BLE manufacture data would be perfect to just get the status and monitor the device values. WiFi is often hard to get working, and BLE actually has longer range in real life :-) Being able to reprogram the device wireless makes it just perfect.
-
I'm thinking of using a MDBT42Q module to poll data from a Modbus device over RS485.
My hardware will use the MAX13487 that implements auto tx/rx switch, I have used this in many designs before and it works just fine with modbus. So no need for TX control pin.
I found this, https://github.com/makejs/modbusTCP-Espruino, but cant make out if its just a clone of modbus-serial or if it's actually for Espruino.. anyone?
-
- 8 comments
- 2,110 views
So a bit more testing done.
I changed my js code so that is dont print anything to the console by it self. So when connecting with the IDE it's silent.
I run EspruinoHub stock, line 423 is active in connect.js.
It starts, finds the devices, updates the mqtt with all the data.
I have enabled all the mqtt options so there is a stream of messages at /ble/# that i subscribe to.
I open the IDE from EspruinoHub, and I can connect to my device. Press enter a few times and I can see the packets on the console from start.sh.
Press disconnect.
After som time the console states "Connection [] IDLE"
But there is no stream of messages on the MQTT, all silent.
The clock is ticking over on the console output from start.sh, but the list of devices does not update.
And reloading the IDE and pressing connect does not show any devices to connect to.