Wireless CO2 monitor - Playground Bootstrap


seems, I stacked on Playgrond Bootstrap step with my first project.
I cannot make Gateway to communicate.
I am always getting response “null”.
gateway/usb-dongle/info : msg.payload : string[4]
Any idea,where issue could be? I follow documentation and until this point, seems, all went fine.
I use Ubuntu 16.04LTS
Thank you

Hi Peter, can you please give me the output from:

pm2 list


pm2 info bcg


pm2 logs bcg

Also make sure that Mosquitto is running and USB Dongle has the most recent firmware in it (you can upload it via bcf).

Thanks. P.


pm2 list
│ Name │ mode │ status │ ↺ │ cpu │ memory │
│ bc-gateway │ fork │ online │ 0 │ 0% │ 19.0 MB │
│ node-red │ fork │ online │ 0 │ 0% │ 70.5 MB │
Use pm2 show <id|name> to get more details about an app

[1]+ Zastavené sudo /usr/local/lib/python3.5/dist-packages/bcg/gateway.py -W

pm2 info bcg
[PM2][WARN] bcg doesn’t exist

pm2 logs bcg
[TAILING] Tailing last 15 lines for [bcg] process (change the value with --lines option)

Mosquitto should run.
ps aux | grep mosquitto
mosquit+ 1123 0.0 0.0 42124 3788 ? S jan06 1:42 /usr/sbin/mosquitto -c /etc/mosquitto/mosquitto.conf
peter 12653 0.0 0.0 14356 936 pts/2 S+ 13:35 0:00 grep --color=auto mosquitto

pm2 show usb-dongle
[PM2][WARN] usb-dongle doesn’t exist

Seems, there is a problem with pm2… How to configure that? Sorry, I am really beginner here…
Thank you,

Dear Peter, please, no more “sorry” about beginning with something. We are really happy to help and we all love to learn new things! :slight_smile:

Thanks for the listing. Apparently it looks like BigClown Gateway is in the list (as bc-gateway), but has quite a different name as opposed we are guiding the users. Which tutorial did you follow,please? This BigClown Gateway translates messages between serial port of the USB Dongle and MQTT broker.

Could you please give me a list of pm2 info bc-gateway and pm2 logs bc-gateway?

Then I suggest to remove it using pm2 delete bc-gateway … we will add it manually later.

You can start the process manually in the foreground with:

bcg --device <PATH>

What is the PATH? You can list your serial port devices with

bcf devices

Your USB Dongle is the one that disappears from the list when you remove it from the port.

So now you can do, e.g.:

bcg --device /dev/ttyUSB0

After that, you should be able to get gateway info. Please, confirm.

Thanks. P.

Hello Pavel,
Well, I used documentation on BigClown page, however, I was not be able to get any response from MQTT (hope, I am correct). So, the name I probably got when I was browsing GITHUB.
Anyhow, here is the list of bc-gateway:

pm2 info bc-gateway
Describing process with id 1 - name bc-gateway
│ status │ online │
│ name │ bc-gateway │
│ restarts │ 0 │
│ uptime │ 7D │
│ script path │ /usr/bin/python3 │
│ script args │ /usr/local/bin/bcg -c /etc/bigclown/bc-gateway.yml │
│ error log path │ /home/peter/.pm2/logs/bc-gateway-error-1.log │
│ out log path │ /home/peter/.pm2/logs/bc-gateway-out-1.log │
│ pid path │ /home/peter/.pm2/pids/bc-gateway-1.pid │
│ interpreter │ none │
│ interpreter args │ N/A │
│ script id │ 1 │
│ exec cwd │ /home/peter │
│ exec mode │ fork_mode │
│ node.js version │ N/A │
│ watch & reload │ ✘ │
│ unstable restarts │ 0 │
│ created at │ 2018-01-06T13:18:11.621Z │
Add your own code metrics: http://bit.ly/code-metrics
Use pm2 logs bc-gateway [--lines 1000] to display logs
Use pm2 monit to monitor CPU and Memory usage bc-gateway

and logs:
pm2 logs bc-gateway
[TAILING] Tailing last 15 lines for [bc-gateway] process (change the value with --lines option)
/home/peter/.pm2/logs/bc-gateway-out-1.log last 15 lines:
/home/peter/.pm2/logs/bc-gateway-error-1.log last 15 lines:
1|bc-gatew | 2018-01-06 14:18:11,864 INFO: Start
1|bc-gatew | 2018-01-06 14:18:11,864 INFO: Serial port: /dev/ttyUSB3
1|bc-gatew | 2018-01-06 14:18:11,864 INFO: MQTT broker host: localhost, port: 1883, use tls: False
1|bc-gatew | 2018-01-06 14:18:11,868 INFO: Connected to MQTT broker with code 0

After, I removed “bc-gateway” as you recommended and reconnected device.
Unfortunately, again I am not getting any response in Node-Red (that was my first problem before I started searching for solution other sources…):
13. 1. 2018, 14:48:15node: 8d17e760.308df
gateway/all/info/get : msg.payload : string[0]

Hi lencpete,

  1. let’s check the gateway. Do you use USB Dongle or Core Module as a gateway connected to your PC? Flash the gateway with the latest firmware with bcf utility https://www.bigclown.com/doc/tutorials/toolchain-guide/, choose the right firmware whether you use USB Dongle bcf-gateway-usb-dongle or Core-Module bcf-gateway-core-module.
  2. stop the pm2 bc-gateway service so we can run it manually from the command line. Something like pm2 stop bc-gateway
  3. please send us the content of /etc/bigclown/bc-gateway.yml for example by cat /etc/bigclown/bc-gateway.yml. Here could be the problem in the config,
  4. We will run bcg manually. We need to find the right device from /dev/. if you use USB Dongle then the --device should be /dev/ttyUSB0, if you use Core Module as a gateway --device should be /dev/ttyACM0. Check that the connected device really appears in /dev/ folder by ls /dev/tty*. Also bcf devices -v will output all the usb-uart devices.
  5. run bcg --device /dev/ttyUSB0 --debug , set the device to the right usb device from the previous step. Also if you have unsufficient access rights ,you’ll have to run bcg with sudo.
  6. disconnect and reconnect the dongle/core-module few times, you should see the messages in the console. Please copy all the output from the bcg here to the forum.


Martin, Pavel, thank you for your support.
Seems, all running fine and as usual, the error was just between chair and keyboard :slight_smile:
I use usb dongle

  1. stop pm2 service
  2. running device with sudo (missing before): "sudo bcg --device /dev/ttyUSB3 --debug

Response without sudo:

bcg --device /dev/ttyUSB3 --debug
2018-01-14 22:48:17,092 INFO: Start
2018-01-14 22:48:17,092 INFO: Serial port: /dev/ttyUSB3
2018-01-14 22:48:17,092 INFO: MQTT broker host: localhost, port: 1883, use tls: False
2018-01-14 22:48:17,097 INFO: Connected to MQTT broker with code 0
2018-01-14 22:48:17,097 DEBUG: subscribe gateway/all/info/get
2018-01-14 22:48:17,097 DEBUG: subscribe gateway/ping

Response with sudo:

sudo bcg --device /dev/ttyUSB3 --debug
[sudo] heslo pre používateľa peter:
2018-01-14 23:12:36,241 INFO: Start
2018-01-14 23:12:36,241 INFO: Serial port: /dev/ttyUSB3
2018-01-14 23:12:36,241 INFO: MQTT broker host: localhost, port: 1883, use tls: False
2018-01-14 23:12:36,246 INFO: Connected to MQTT broker with code 0
2018-01-14 23:12:36,247 DEBUG: subscribe gateway/all/info/get
2018-01-14 23:12:36,247 DEBUG: subscribe gateway/ping
2018-01-14 23:12:36,253 INFO: Opened serial port: /dev/ttyUSB3
2018-01-14 23:12:36,253 DEBUG: Exclusive lock on file descriptor: 6
2018-01-14 23:12:36,254 DEBUG: write b’["/info/get", null]\n’
2018-01-14 23:12:36,277 DEBUG: read b’["/info", {“id”: “836d1983660f”, “firmware”: “bcf-gateway-usb-dongle”, “version”: “v1.7.4”}]\n’
2018-01-14 23:12:36,277 DEBUG: subscribe gateway/usb-dongle/+/+
2018-01-14 23:12:36,277 DEBUG: node_rename 836d1983660f to usb-dongle
2018-01-14 23:12:36,278 DEBUG: write b’["$eeprom/alias/add", {“name”: “usb-dongle”, “id”: “836d1983660f”}]\n’
2018-01-14 23:12:36,278 DEBUG: write b’["$eeprom/alias/list", 0]\n’
2018-01-14 23:12:36,548 DEBUG: read b’["$eeprom/alias/add/ok", “836d1983660f”]\n’

My config file should be than set correctly (/etc/bigclown/bc-gateway.yml):
device: /dev/ttyUSB3
host: localhost
port: 1883
836d1983660f: usb-dongle

I was able to pair with Wireless CO2 Monitor without any other issue and currently getting responses to node-RED…
Once again, thank you!

1 Like

That’s great that it is running now. Let us know if you will have any questions or issues in the future.


1 Like