Core module as a gateway not working?

Hi, I am successfully using dongle with couple of nodes, but through couple of walls the connectivity is rather unstable. So I wanted to try out the new external antenna core module as a dongle if that would help.
Unfortunately that does not work. Folowing the guide https://tower.hardwario.com/en/latest/tools/hardwario-gateway/ was first not even able to crete udev rule. there is old idVendor and idProduct in the core-module section.
After correcting that i can start bcg-cm via pm2 without error and connect to mqtt. However bch gw list gives me “code-module None” and nodered list all gateways I get response from core-module “null”.
Not really sure where to go next. Is the firmware hio-gateway-core-module:1.13. up todate for core module - r2 ?
thanks

Hi, I’ve done some initial testing for now, we will look deeper but this is what I’ve discovered now.

It seems that binary firmware is release for older R1 Core Module which does not have FTDI chip. By default it is set in a way that STM32 is itself USB CDC serial device.

In application.h I set this define to 0 to fix it:

#define TALK_OVER_CDC 0

Then clean and compile project with make core-module -j

Now when I connect over USB to terminal I can see the low-level JSON communication explained here
https://tower.hardwario.com/en/latest/interfaces/serial-port-json/#json-format

I’m able to see firmware info from Core Module Gateway, see the button presses and temperature on the gateway. I even tried to start pairing by command ["/pairing-mode/start", null] and I sucesfully paired Button Kit

["/info", {"id": "f2e0f24e292c", "firmware": "bcf-gateway-core-module", "version": "vdev"}]
["f2e0f24e292c/thermometer/0:1/temperature", 26.12]
["f2e0f24e292c/push-button/-/event-count", 0]
["f2e0f24e292c/push-button/-/event-count", 1]

["/pairing-mode", "start"]
["/attach", "836d19834966"]
["836d19834966/info", {"firmware": "push-button", "version": "v1.4.1", "mode": 3}]["836d19834966/thermometer/0:1/temperature", 23.88]
["836d19834966/push-button/-/event-count", 1]
["836d19834966/orientation", 1]
["836d19834966/push-button/-/event-count", 2]
["836d19834966/push-button/-/event-count", 3]
["836d19834966/push-button/-/event-count", 4]
["836d19834966/push-button/-/event-count", 5]
["/pairing-mode", "stop"]

However I’m not able to get it running with bcg.

In bcg it freezes here

martin@hp:~/Documents/PlatformIO/Projects/ESP32-epaper$ bcg --device /dev/ttyUSB0 
2021-04-29 19:51:02,079 INFO: Start
2021-04-29 19:51:02,079 INFO: Serial port: /dev/ttyUSB0
2021-04-29 19:51:02,079 INFO: MQTT broker host: 127.0.0.1, port: 1883, use tls: False
2021-04-29 19:51:02,082 INFO: Opened serial port: /dev/ttyUSB0
2021-04-29 19:51:02,083 INFO: Connected to MQTT broker with code 0

In playground I see the device but nothing happens after I press Connect button

I hope that @Karel would help us :slight_smile: Thanks

Hi, so the bcg is working :slight_smile: I just expected that messages will appear in the console and do not used MQTT to take a deeper look :slight_smile: I had to run bcg with --debug to see the messages.

bcg --device /dev/ttyUSB0 --debug

Because it is Core Module, it will publish topic to node/core-module/... topic. So it will work, however if you use Hardwario/Bigclown hub web interface, it expects that you use USB Dongle which connects to node/usb-dongle/.. topic. But this could be easily configured by YAML config (bcg does not have command line parameter for this).

I created bcg-core-config.yml and the name: "usb-dongle" is the important part:

device: /dev/ttyUSB0
name: "usb-dongle"
mqtt:
  host: localhost
  port: 1883

Then I run

bcg --config bcg-core-config.yml --debug

And Core Module is publishing to the node/usb-dongle/... topic so the MQTT messages for dongle pairing, node rename and node delete will work properly when you use Hardwario/Bigclown hub or even if you run playground on the same machine with bcg.

martin@hp:~/Documents$ bch sub
2021-05-02 13:34:54.79 node/usb-dongle/push-button/-/event-count 34
2021-05-02 13:36:25.32 gateway/usb-dongle/pairing-mode/start null
2021-05-02 13:36:25.33 gateway/usb-dongle/pairing-mode "start"
2021-05-02 13:36:26.24 gateway/usb-dongle/pairing-mode/stop null
2021-05-02 13:36:26.26 gateway/usb-dongle/pairing-mode "stop"

Let me know if you get it running.

I also add compiled firmware with that #define TALK_OVER_CDC 0 and make core-module -j mentioned in my previous post.
gateway-core-module-r2.bin (163.3 KB)