# MQTT name length

**URL:** https://community.garadget.com/t/mqtt-name-length/8527
**Category:** Apps
**Created:** [September 21, 2021, 10:17pm UTC](https://community.garadget.com/t/mqtt-name-length/8527 "2021-09-21T22:17:31Z")
**Posts on this page:** 4
**Page:** 2

<div class="post-metadata">

### Author: ![hi-flyer](https://community.garadget.com/user_avatar/community.garadget.com/hi-flyer/32/2457_2.png) [@hi-flyer](https://community.garadget.com/u/hi-flyer)
#### Post date: [September 30, 2021, 7:16pm UTC](https://community.garadget.com/t/mqtt-name-length/8527/21 "2021-09-30T19:16:02Z")

</div>

ps as a note to you, Firefox did not work for the setup portion of the configuring. I had to use chromium browser.

---

<div class="post-metadata">

### Author: ![garadget](https://community.garadget.com/user_avatar/community.garadget.com/garadget/32/34_2.png) [@garadget](https://community.garadget.com/u/garadget)
#### Post date: [September 30, 2021, 9:32pm UTC](https://community.garadget.com/t/mqtt-name-length/8527/23 "2021-09-30T21:32:43Z")

</div>

Thank you for your write up!

---

<div class="post-metadata">

### Author: ![hi-flyer](https://community.garadget.com/user_avatar/community.garadget.com/hi-flyer/32/2457_2.png) [@hi-flyer](https://community.garadget.com/u/hi-flyer)
#### Post date: [September 30, 2021, 9:41pm UTC](https://community.garadget.com/t/mqtt-name-length/8527/24 "2021-09-30T21:41:36Z")

</div>

be nice if in your next released version, you opened PORT\_BUFFER a little so other users (i.e. nymea will not have to go thru this pain).  
thanks

---

<div class="post-metadata">

### Author: ![hi-flyer](https://community.garadget.com/user_avatar/community.garadget.com/hi-flyer/32/2457_2.png) [@hi-flyer](https://community.garadget.com/u/hi-flyer)
#### Post date: [October 3, 2021, 5:29pm UTC](https://community.garadget.com/t/mqtt-name-length/8527/25 "2021-10-03T17:29:30Z")

</div>

sorry I got the above steps to change nme to 32 characters wrong. these are the correct steps.  
Steps I used to create a new version of Garadget on ubuntu 20.04 to increase the allowable length of nme to 32 characters  
review [Build - Particle Firmware](https://particle-firmware.readthedocs.io/en/develop/build/)  
review [MQTT support - #5 by garadget](https://community.garadget.com/t/mqtt-support/3226/5)

if ubuntu version of gcc-arm is installed, remove it (I use synaptic to find it) and the sudo apt autoremove to clean all out.  
open browser to [GNU Toolchain | GNU Arm Embedded Toolchain Downloads – Arm Developer](https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-rm/downloads)  
select GNU Arm Embedded Toolchain: 10-2020-q4-major December 11, 2020  
download gcc-arm-none-eabi-9-2020-q2-update-x86\_64-linux.tar.bz2 to home directory  
file-roller gcc-arm-none-eabi-9-2020-q2-update-x86\_64-linux.tar.bz2  
extract to home directory  
export PATH="$PATH:/home/homedirectory/gcc-arm-none-eabi-9-2020-q2-update/bin  
export PLATFORM=p1  
git clone --recursive --branch v2.0.1 [https://github.com/particle-iot/firmware.git](https://github.com/particle-iot/firmware.git) Particle  
cd Particle/user/application  
git clone [https://github.com/Garadget/firmware](https://github.com/Garadget/firmware) garadget  
in my case edit garadget/src/global.h  
change MINOR\_VERSION 25 (changed so you know you have loaded the changes into your device)  
change MAXNAMESIZE to 33  
change PORT\_BUFFER to 0x22  
save  
cd ~/Particle/modules  
make clean all APP=garadget  
when finished  
sudo apt install mosquitto-clients  
connect your device usb to your computer and make sure your broker is up  
open terminal  
mosquitto\_sub -v -h ip of your broker -t garadget/# this is to show you the device is connected  
Put your device into the DFU mode by holding down the mode/setup button on the device and then tapping on the RESET button once. Release the MODE/setup button after you start to see the RGB LED flashing in yellow. It’s easy to get this one wrong: Make sure you don’t let go of the MODE/SETUP button until you see flashing yellow, about 3 seconds after you release the RESET button. A flash of white then flashing green can happen when you get this wrong. You want flashing yellow.  
dfu-util -l (to make sure device is in dfu mode. My yellow blinking really looked geen to me but have fun here).  
dfu-util -d 2b04:d006 -a 0 -s 0x80A0000:leave -D ~/Particle/build/target/user-part/platform-8-m/garadget.bin  
I did not update system-part1.bin or system-part2.bin (although I suspect I could have).

I then checked if mosquitto\_sub give a line like garadget/garage/config {“sys”:“2.0.1”,“ver”:“1.25”,“id”:“2d0022001447373033383530”,“ssid”:“wifi network name”,“rdt”:1000,“mtt”:10000,“rlt”:300,“rlp”:1000,“srt”:25,“nme”:“garage”,“mqtt”:2,“mqip”:“broker ip address”,“mqpt”:1883,“mqus”:"",“mqto”:5000}  
if not Put your unit into listening mode: press and hold “M” button for about 3 seconds until LED starts blinking dark blue.  
Connect any WiFi enabled device to PHOTON-XXXX access point.  
Open [http://192.168.0.1/](http://192.168.0.1/) in the browser (Firefox failed for me) and (re-)configure WiFi connection, MQTT settings, and topic setting  
Submit to save. The device should reconnect to your WiFi network. (did not for me so I hit R to reset device and it came up)  
check mosquitto\_sub again and should show the config line

final check is  
open another terminal and assuming the topic is garage  
mosquitto\_pub -h ip of your broker -t garadget/garage/command -m “get-status” should immediately responed with a status line  
mosquitto\_pub -h ip of your broker -t garadget/garage/set-config -m ‘{“nme”:“1234567890123456789012”}’ this number should show up in the config status in the mosquitto\_sub terminal  
now its accepting 32 characters in the nme that I need for nymea plugin I am developing for NYMEA

have fun

[Previous page](https://community.garadget.com/t/mqtt-name-length/8527.md?page=1)
