Help please ! total noob here !!
-
The mqtt gateway sketch in the build section of the mysensors site will create an mqtt broker. If you want the gateway to act as an mqtt client you have to use the dev branch, ie not any 1.5 releases, mysensors library and mqtt gateway sketch at github.
The pinned guide in the forum about mqtt client gateway is for the dev branch library. If you read the first post carefully you should be able to set that up. But first you need to have a copy of the dev branch mysensors library in your Arduino IDE, so that you can build the mqtt client sketch.
-
OK thank you ! and if i use another code can i use the same wiring ?
-
Yeah, the wiring should be the same for both release and dev branch, to my knowledge.
-
Hum ... when i use this code : https://www.mysensors.org/build/mqtt_gateway
I can ping my arduino
But when i use the one you told me to : https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/examples/GatewayW5100MQTTClient/GatewayW5100MQTTClient.ino
I can't ping it .. what happen ? is it because it's not the same wiring ?
-
Are you sure you have the correct address? Have you changed the sketch and defined the ip address of the arduino or commented those lines? If you comment them, you should use the address that your router or similar assigns to the arduino.
/ Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) #define MY_IP_ADDRESS 192,168,178,87 // If using static ip you need to define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,178,1 #define MY_IP_SUBNET_ADDRESS 255,255,255,0 -
Ok that is weird ! I try with and without static adress and it both didn't work BUT the first time I try without static IP it worked ! the ping worked ! so i try to unplug the arduino to see if it was the right device and yes the ping stop so I plug it back and since then ... nothing ...
I was wondering, I replace all the mysensor library with de developer branch is that ok ?
-
Yes, you should replace the whole library when changing between versions. Personally I use git for this, but you can also just delete the old library and copy/paste the new library.
-
ok so what is wrong then ?
-
How do you know the ip address of the arduino when not setting a static ip in the sketch or in the config? Have you mapped a static ip to the mac address of the arduino in your router?
If you're 100% sure you're pinging the correct address each time, and you successfully pinged the arduino after one boot but not after a restart with the same sketch, I would suspect hardware problems. Could be a power issue.
-
Hi, first of all, thank you very much for helping me like that !
I'm a Noob with my sensor but i'm a network guy (it's my job !) I know how to find an ip address !
I know pretty much all my device on my network so i just look on my dhcp server to see if new device show up . Also i use a software to scan every device on the network
I don't map the mac adress because i didn't have the time. Like I said it work only one time.
I was afraid that was a physical problems so I retry with the first sketch
( https://www.mysensors.org/build/mqtt_gateway )And it work ! I ping it without any problem...
EDIT : I just saw this in my code :
//W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) //#define MY_W5100_SPI_EN 4Do I need to uncomment the second line ?
-
It look like the issue come from the dev branch :
https://forum.mysensors.org/topic/1728/uno-ethernet-shield-radio-init-fail-solved/2
Is there something i can do ?