Page 3 of 5

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 12, 2021 9:24 pm
by rvdbreemen
hvxl wrote:I loaded the binary images (using `esptool.py --baud 921600 write_flash 0 OTGW-firmware.ino.bin 0x200000 OTGW-firmware.spiffs.bin`, none of that cumbersome messing with a GUI).
Just realized that that only works if you have esptool.py installed. So I will put in the documentation, for people that like to do that using a CLI. Great tip!

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 12, 2021 10:29 pm
by hvxl
You can also download the older esptool from https://github.com/igrr/esptool-ck/releases. Then the command is:
  • esptool -cd nodemcu -cb 921600 -cf OTGW-firmware.ino.bin -ca 0x200000 -cf OTGW-firmware.spiffs.bin
I use 921600 baud, because at 115200 baud it takes ages. Especially because this tool downloads the whole 2MB SPIFFS. The python tool compresses that to 24848 bytes. So esptool takes over a minute to flash the device, while esptool.py does it in less than 20 seconds (both at 921600 baud).

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 12, 2021 10:34 pm
by hvxl
rvdbreemen wrote:The deperication of SPIFF is recent, you are so right that I need to implement LittleFS. It is on my bucketlist, but for now SPIFF does the job without a problem.
Converting to LittleFS is normally just a matter of replacing '#include <FS.h>' by '#include <LittleFS.h>' and a global replace of 'SPIFFS' into 'LittleFS'.

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 12, 2021 11:31 pm
by rvdbreemen
hvxl wrote:
rvdbreemen wrote:The deperication of SPIFF is recent, you are so right that I need to implement LittleFS. It is on my bucketlist, but for now SPIFF does the job without a problem.
Converting to LittleFS is normally just a matter of replacing '#include <FS.h>' by '#include <LittleFS.h>' and a global replace of 'SPIFFS' into 'LittleFS'.
Checking now what the impact is ;-) Thanks for the tip, just had not looked into this.

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 12, 2021 11:35 pm
by rvdbreemen
hvxl wrote:You can also download the older esptool from https://github.com/igrr/esptool-ck/releases. Then the command is:
  • esptool -cd nodemcu -cb 921600 -cf OTGW-firmware.ino.bin -ca 0x200000 -cf OTGW-firmware.spiffs.bin
I use 921600 baud, because at 115200 baud it takes ages. Especially because this tool downloads the whole 2MB SPIFFS. The python tool compresses that to 24848 bytes. So esptool takes over a minute to flash the device, while esptool.py does it in less than 20 seconds (both at 921600 baud).
That's even better, I added it to the documentation, here.

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Thu Jan 14, 2021 10:52 am
by mlommers
hvxl wrote:
mlommers wrote:When the OTGW is connected no other devices are supported to connect next to the OTGW.
Did you try, or is your conclusion based on the Nodo shop documentation again? I don't see a reason why it wouldn't be possible to connect temperature sensors in addition to an OTGW.
I did try, but didn't get OTGW data untill i removed the DS18B20 devices...maybe I did something wrong or it is another coincident configuration i missed at the same time. but after removing the other devices I got OTGW data in otmonitor

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Sat Jan 16, 2021 4:27 pm
by Templar
rvdbreemen wrote: .................. This got me thinking it should be possible to create OTGW firmware running on the NodeMcu 8266 hardware running on this gateway......
Hi rvdbreemen,

I've got a slightly differend hardware setup. The classic OTGW hardware with the Recom DC/DC convertor mod. And instead of the MAX232 IC, I connected a ESP8266-12E VCC=5V. On it I run the ESP-LINK: Wifi-Serial Bridge w/REST&MQTT V2.2.3. To use your Nodemcu firmware the only thing I need to do is altering these PIN definitions in the OTGW-Core.ino file? It has been 4 years ago I set this up..

Code: Select all

#define PIN_I2C_SDA 4
#define PIN_I2C_SCL 5

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Tue Jan 19, 2021 10:24 pm
by hvxl
Another suggestion triggered by this topic: An option to send the appropriate SC command to the gateway every minute.

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Mon Jan 25, 2021 9:11 am
by rvdbreemen
hvxl wrote:Another suggestion triggered by this topic: An option to send the appropriate SC command to the gateway every minute.
After I have a reliable PIC upgrade this is on my list of things to add to the firmware. Controlling the OTGW with advanced commands, like setting lock using the SC command. Or sending a time based setting at different moments in the day.

But first let’s make sure the PIC upgrade is 100% safe.

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Thu Feb 11, 2021 12:05 am
by bartlemoose
Updated to 0.7.5, cheers :)

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Thu Feb 11, 2021 1:28 am
by rvdbreemen
Just released the next release of this OTGW firmware for the Nodoshop version, version 0.7.5.
Longer in development, but worth it. Still a large backlog of improvements to come.

This release features:
  • reliable and direct flash the otgw pic firmware version 5.0 from the ESP chip. The upgrade code was developed by Bron Schelte and now integrated in in my release.
  • breaking change: moving over to the LittleFS filesystem (reflashing needed)
  • toggle to turn off MQTT message integration
  • multiple bugfixes, in for example: settings page did not always save data
and much more... Read the README to find out more: https://github.com/rvdbreemen/OTGW-firmware
Please enjoy the latest release, if you find anything, just put an issue in at github, add code to grow the features, or add new ideas, or do a pull request to the codebase, documentation, wiki pages, ....

Kind regards,
Robert

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Sun Feb 14, 2021 1:11 pm
by franz
Hej Robert,

first - thanks for your work. Yesterday I soldered together and installed my Nodoshop OTGW and it worked flawlessly!

Now - I can read MQTT messages, but I cant figure how to send commands.

topic MQTT/command with one of the serial commands as payload , e.g. "TT=16" ?

Thanks,
Franz

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Thu Feb 25, 2021 9:18 am
by rvdbreemen
franz wrote: topic MQTT/command with one of the serial commands as payload , e.g. "TT=16" ?
The OTGW/command topic was broken for a few releases. It’s been fixed in v0.7.7. You should try that version to make it work.

Robert

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Mon Mar 01, 2021 8:29 pm
by franz
Hej,

thanks for the reply. I have 0.7.8+702 (25-02-2021) now. I tried the api first, no success. The website shows:
OTGW firmware

[/api/v1/otgw/command/TT=10] is not a valid
Is that how it is supposed to work? Haven't tried MQTT yet again.

Thanks,
Franz

Re: Creating my own OTGW firmware for the NodoShop version

Posted: Fri Mar 05, 2021 9:25 pm
by franz
Hi again,

I have now tried to send a command by MQTT and succeeded. Thank you.

I still cant get the command API to work, I tried as below and always get the (incomplete) error message as per my previous post.

/api/v1/otgw/command/"OT=20"
/api/v1/otgw/command/OT20
/api/v1/otgw/command/{OT=20}

Maybe I am just blind?