Bcg USB communication on Windows 10 64-bit

Hello,
I am starting with BigClown and trying to get messages from a Core Module - without success.
Is there any tutorial for it or can you help?

My OS is Windows 10 64-bit.
I have installed Playgroud 1.0.9 and Toolchain 1.3.0.
Downloaded and built the latest BCF gateway firmware, successfully uploaded it into the Core Module.
The Core Module is connected to the COM11 port.
I have started a BigClown Gateway: pm2 start “%BigClownGateway%” --name bcg – --device COM11
and have checked it runs.
When I start mosquitto I cannot see any MQTT message.
mosquitto_sub -t “#” -v

What am I doing wrong?
Am I missing something?

thank you
Zdenek

Hi,
first you can test that mosquitto is running properly:

This command (from different terminal):
mosquitto_pub -t 'test/1' -m 'test msg'

should return:
test/1 test msg

Yes,
I have tried the communication recently with
mosquitto_pub -h 127.0.0.1 -t topic -m “Ahoj”
and have received
topic Ahoj

And also your test succeeds, after replacing Linux strings with Windows ones:
mosquitto_pub -t “test/1” -m “test msg”

Ok,
then try:
mosquitto_pub -h router -t 'gateway/all/info/get' -n

My returns:

gateway/all/info/get (null)
gateway/usb-dongle/info {"id": "836d19838d67", "version": "v1.8.0", "firmware": "bcf-gateway-usb-dongle"}

Unable to connect (Lookup error.).

I have tried now to rebuild and re-upload the firmware - no success.
Source: https://github.com/bigclownlabs/bch-gateway
make
bcf flash --dfu firmware.bin

Did you tested pre-compiled gateway firmware?

$ bcf update
update data for repo bigclownlabs/bcf-ping-pong-table

$ bcf list
bigclownlabs/bcf-climate-station:firmware-142pixel.bin:v1.0.1
bigclownlabs/bcf-climate-station:firmware-144pixel.bin:v1.0.1
bigclownlabs/bcf-climate-station:firmware-72pixel.bin:v1.0.1 
bigclownlabs/bcf-gateway-core-module:v1.8.0                  
bigclownlabs/bcf-gateway-usb-dongle:v1.8.0                   
bigclownlabs/bcf-generic-node-battery-mini:v1.7.4            
bigclownlabs/bcf-generic-node-battery-standard:v1.7.4        
bigclownlabs/bcf-generic-node-power-module-rgb150:v1.7.4     
bigclownlabs/bcf-generic-node-power-module-rgb300:v1.7.4     
bigclownlabs/bcf-generic-node-power-module-rgbw144:v1.7.4    
bigclownlabs/bcf-generic-node-power-module-rgbw72:v1.7.4     
bigclownlabs/bcf-kit-push-button:v0.1.0                      
bigclownlabs/bcf-kit-sigfox-climate-monitor:v1.0.1           
bigclownlabs/bcf-kit-sigfox-co2-monitor:v1.1.0               
bigclownlabs/bcf-kit-sigfox-motion-detector:v1.0.1           
bigclownlabs/bcf-kit-sigfox-pulse-counter:v1.1.0             
bigclownlabs/bcf-kit-sigfox-push-button:v1.0.0               
bigclownlabs/bcf-kit-thermostat-lcd:v0.2.0                   
bigclownlabs/bcf-kit-wireless-climate-monitor:v1.3.0         
bigclownlabs/bcf-kit-wireless-co2-monitor:v1.3.0             
bigclownlabs/bcf-kit-wireless-flood-detector:v1.3.0          
bigclownlabs/bcf-kit-wireless-lcd-thermostat:v1.3.0          
bigclownlabs/bcf-kit-wireless-motion-detector:v1.3.0         
bigclownlabs/bcf-kit-wireless-power-controller-rgb150:v1.2.2 
bigclownlabs/bcf-kit-wireless-power-controller-rgbw144:v1.2.2
bigclownlabs/bcf-kit-wireless-power-controller-rgbw72:v1.2.2 
bigclownlabs/bcf-kit-wireless-push-button:v1.3.0             
bigclownlabs/bcf-lcd-thermostat:v1.0.0                       
bigclownlabs/bcf-ping-pong-table:firmware.bin:v1.0.0         
bigclownlabs/bcf-sigfox-button:v1.0.0                        
bigclownlabs/bcf-sigfox-climate-monitor:firmware.bin:v1.0.1  
bigclownlabs/bcf-sigfox-co2-monitor:firmware.bin:v1.0.0      
bigclownlabs/bcf-sigfox-motion-detector:firmware.bin:v1.0.1  
bigclownlabs/bcf-sigfox-pulse-counter:firmware.bin:v1.1.0    
bigclownlabs/bcf-skeleton-core-module:firmware.bin:v1.0.0    
bigclownlabs/bcf-usb-dongle:v1.5.5                           
bigclownlabs/bcf-usb-gateway:firmware.bin:v1.5.0             
bigclownlabs/bcf-wireless-pulse-counter:v1.0.0               

$ bcf flash --dfu bigclownlabs/bcf-usb-gateway:firmware.bin:v1.5.0

You must switch core module flash mode - keep “B” button pressed during plugin USB cable in.

Another info:
When I flash the bcf-gateway-core-module-v1.8.0.bin, it communicates with mosquitto (sends data).
source: https://github.com/bigclownlabs/bcf-gateway/releases/download/v1.8.0/bcf-gateway-core-module-v1.8.0.bin

mosquitto_pub -h router -t “gateway/all/info/get” -n
still sends Unable to connect (Lookup error.)

I can get the “router” message after I press the RESET button:
gateway/core-module/info {“id”: “836d1983814e”, “firmware”: “bcf-gateway-core-module”, “version”: “v1.8.0”}
gateway/core-module/nodes []

When I download a SRC from https://github.com/bigclownlabs/bcf-gateway/archive/v1.8.0.zip
add
#define CORE_MODULE 1
make
bcf flash --dfu firmware.bin
then no message arrives

Zdenek

Try:

make core-module-release

See https://github.com/bigclownlabs/bcf-gateway/blob/master/Makefile for details.

mosquitto_pub -h router -t “gateway/all/info/get” -n
still sends Unable to connect (Lookup error.)

Sorry for confusion. The option -h router is for hostname. I forgot to remove it :frowning:

Try without it. If not set, localhost is used.

mosquitto_pub -t “gateway/all/info/get” -n

It works now.
Thank you for the help.
Conclusion: I did not realized that I must have a look into the makefile and find parameters there.
That is because of lack of experience with C (I have started with C several days ago when I received BigClown modules).

Well, maybe this should be mentioned in documentation. I expect this is automatically covered by development tool, like Visual Studio, but if you use only simple or more clever text editor and command line (not IDE), this could help.

I tried to build with VS Code but it fails with
c:/program files (x86)/bigclown toolchain/make/sh: syntax error: unexpected “(”
make: *** [sdk/Makefile.mk:165: debug] Error 2
The terminal process terminated with exit code: 1
and I do not want to find a cause for now.
So, I stuck with a command line make.