MQTT name length

I have a garadet system. I use nymea as my control application. I am trying to develop a plugin for Nymea. Nymea uses a uuid as the name for device name. Garadget set the MAXNAMESIZE in the global.h set to 31 characters which translates to 30 characters the system currently accepts. Nymea needs garadget to accept 32 characters. Is there any reason this cannot be increased to say 34 to allow full integration with nymea?

You can go ahead and increase that to a longer string.
The reason it was set to 31 is because at the time that was sufficient and there was no know case where it needed to be any longer.

ok, so how should I go about compiling it for upload and then the proper method to upload. I saw some old posts on this but the links you gave (i.e. for the binary download) are no longer valid and i am not sure process pointed out is either. I use ubuntu 20.04 as my operating system. The garadget unit is set to mqtt only.

Also FYI, I have connected my Decko Garage door opener to the Garadget but had to have a 3.3 volt zener diode in series with the Garadget relay to make it work because of the way Decko does their product (i.e. full short only kicks the light on and off).

Thanks for any help on this.

Garadget uses Particle P1 module so their toolchain documentation applies.

Thank you for the info on Decko GDO. Somebody else might need it so it’s good to have it searchable here.

Also a second question, is there a method to get the Garadget to send the configuration status when you do not know the current topic value (to trigger it) or have a http message accepted to reconfigure the Garadget. (yes I know you can go back to the unit and reinitialize the unit from there but would like to avoid that method if I can). Obviously, I will know the ip address from my router.

There is a get-config parameter to the command topic.
You can find full details in this post:

I understand and works if I know the topic and have done that. But if I do not know the topic which in my case defaults to garadget/garage - ie I have changed garage to something else and lost the nme how to I do the command to the unit to trigger the message as garadget/garage will not work any more?

Such functionality is not supported at this time.
The name is usually assigned at the setup and not changed frequently. If you are comfortable around source code you can lock the topic to device ID which is permanently assigned.

Thanks, for all the help. I will let you know how my efforts go.

So I am not clear I am doing this correctly but here are my steps before I actually try to reprogram the Garadget device:
download from Garadget/firmware github to ~/nymea-testing/Garadget-source
unzip file to ~/nymea-testing/Garadget-source/
modify global.h MAXNAMESIZE 34
cd ~/nymea-testing/Garadget-clone
git clone
cd firmware/main (I tried module but that failed and doc suggested going to main)
make clean PLATFORM=photon APPDIR=~/nymea-testing/Garadget-source/firmware-master/src/ TARGET_DIR=~/nymea-testing/Garadget-source/ -s program-dfu
and got the following:
~/nymea-testing/Garadget-source/firmware-master/src/nodes/node-relay.cpp: In member function ‘virtual bool c_relay::f_receive(const c_message&)’:
~/nymea-testing/Garadget-source/firmware-master/src/nodes/node-relay.cpp:78:23: warning: this statement may fall through [-Wimplicit-fallthrough=]
78 | n_newStatus = STATUS_OPENING;
| ^~~~
~/nymea-testing/Garadget-source/firmware-master/src/nodes/node-relay.cpp:79:9: note: here
79 | case STATUS_CLOSED:
| ^~~~
dfu-suffix (dfu-util) 0.9

Copyright 2011-2012 Stefan Schmidt, 2013-2014 Tormod Volden
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to

Suffix successfully added to file
Serial device PARTICLE_SERIAL_DEV : not available
Flashing using dfu:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to

dfu-util: No DFU capable USB device available
make[1]: *** […/…/…/build/ program-dfu] Error 74
make: *** […/build/ modules/photon/user-part] Error 2

this creates the directory ~/nymea-testing/Garadget-source/obj/src with 8 files

Ok the last errors are because the laptop is not connected to the Garadget device I believe

  1. is the warning above a problem?
  2. Have I actually probably created the correct files for upload to the device (assuming I connect the device to the laptop)

I trying to be careful so I do not destroy my device.

I checked the source and the fall-through in switch statement is intentional so it’s safe to ignore the warning. Also it is safe to upload the firmware. If anything goes wrong the bootloader is not affected and you can restore the stock firmware.

I assume that to restore the stock firmware I first need to do a dfu-util --upload Garadget.

my assumption is based on the fact that I have cut off access to the internet from the device.

Here’s the thread with the binaries and instructions for the stock firmware:

yea I had previously found that link but the link to the binaries is no longer valid
link for system and v1.20 firmware binaries

Here’s the link for latest 1.24 binaries.

Thank you. Appreciate.

I do not know what I have done wrong but I now have a device that is not working.

I did the following: To enter DFU Mode:

  1. Hold down BOTH buttons
  2. Release only the RESET button, while holding down the SETUP button.
  3. Wait for the LED to start flashing yellow (it will flash magenta first)

but the yellow flashing did not ever happen. (tried many times)
What I get is magenta medium flash, green medium flashing, green fast flashing, white medium flashing, white solid, led off, followed by the same sequence over again. (i.e. no yellow).

Also now on just hitting reset or powering off/on, I get a blue slow flash (listening mode?) that I can connect my computer wift to the Photon-PPF2UR wifi and ping the device but the device will NOT allow on either safari, firefox, or choromium browsers.

Have not ever gotten to the dfu mode.
What am I doing wrong?
and more importantly How do I get the device working again?

The URL for web interface is not
If you can get your unit online, let me know the device ID and I’ll try to re-flash it remotely.
DFU programming will not work if you can’t get it in DFU mode.
You can re-upload bootloader in setup mode (blinking dark blue on and off) with this command:

particle flash --serial p1-bootloader@2.0.1+lto.bin

Ok the particle flash you suggested did not do the trick. On the other hand particle setup when the device is plugged into my computer usb did the trick and got me back working (yea).

I finally figured out the the yellow is not a clear yellow but I did get the device in dfu mode but so far am unsuccessful with the compiled version of the garadget code. I did upload but lost control of the device configuration (went to cloud only on mqtt and I could not change that).

OK, Success -FINALLY
MAXNAMESIZE was the wrong variable. It turns out that PORT_BUFFER needed to be increased!
I set it at 0x24 although 0x22 would probably work as well.

Thanks for the help and the patience with me and my fumbling around on this.
now back to nymea.

1 Like