I assumed that my desk was a kind of a mess... but now I realize it's just average!
MatiasV
@MatiasV
Best posts made by MatiasV
-
RE: Your workshop :)
-
FOTA/MYSBootloader - Documentation enhacement - Make it clear that you must program only the MYSBootloader, without sketch
Hi all,
I tried to get FOTA working two times before, and I was about to give up a third time as I had always the same problems:- After programming the MYSBootloader I loose the ability to do upload sketches via FTDI (with both pro-mini, nano's and barebones 328P)
- With MySController I could not upload any new FW, even a simple reboot command make the arduino to lock hard and it had to be powered down.
I tried the oficial github firmwares , the ones from GuilleBot I played with fuses, boards.txt, platformio.ini setting, different GWs, etc, etc, etc....
Last night I found this issue in github that gave me the detail that was missing. Just do not upload a sketch to the board, only program the MYSBootloader and wait until it asks the FW to the controller!Another source of confusion, at least for me, was that I did not knew what to expect of the whole process. What where the different steps and the expected duration of the upload. I will try to describe my setup and how I could finally get it working.
MySetup
- Controller: HomeAssistant
- GW:MQTT GW using ESP8266
- Portainer from the HomeAssistan AddOns
- MQTT from the HomeAssistan AddOns (mosquitto)
- FW Controller - MYCONTROLLER.ORG using MQTT GW.
Follow this post instructions
I installed it with docker in the same machine as HA using Portainer and cdrocker's image - Platformio.org for building sketches and programming bootloaders
Out of scope of this post, but way better than using Arduino. Totally worth the pain of learning it's basics. - A MQTT Gui to see what is happening between the node and the controller
I'm using MQTT EXplorer - An Arduino UNO as an ISP
- Sensors: A big mess of half working handmade boards, EasyPCB and SlimNode Sensors.
Steps
-
Get the correct MYSBootloader for your setup
Check GuilleBot repository if you are using another nfr24 channel or want to play with different radio power -
Modify boards.txt or your platformio.ini to add the bootloader
In my case, for the nano:
[platformio] default_envs = MYSBootloaderNano [env] platform = atmelavr framework = arduino upload_protocol = stk500v1 upload_port = /dev/ttyACM0 upload_speed = 19200 upload_flags = -v -e -P$UPLOAD_PORT -b$UPLOAD_SPEED lib_deps = MySensors MySensors NodeManager [env:MYSBootloaderNano] board = nanoatmega328new board_bootloader.file = bootloader/MYSBootloader_16MHz.hex
The important bits, the upload_flags specially the -e to erase the memory and the board_bootloader.file
- Program only the bootloader (and the fuses if necessary), for platformio:
$ platformio -f -c vim run --target bootloader
- Build the FW of your node, and copy the .hex somewhere on your PC. Again for platformio:
$ platformio -f -c vim run --target run
Look in .pio/build/<board>/
-
Add the FW to MyController.org following the product manual
-
Build your HW if needed, plug the radio, etc
-
Be sure to keep the MQTT Explorer and MyController.org to see some feedback of the whole process
-
Powerup the sensor
-
You will see a new node with ID 1 in MyController.org, if you look in "Status -> Resources logs" or in the MQTT Explorer you should see the node asking for a new FW.
-
In MyController.org assign the FW to the new node with ID 1 and upload it.
Check the manual if in doubt. -
You will see in MQTT Explorer that the controller and the node get very chatty. The node will ask for each piece of the HEX in small batches.
-
You have some time now, get up and make yourself a cup of coffee and prepare a small celebration.
-
Check the MQTT Explorer, the FW is still uploading... go and get some confetti.
-
Check Mycontroller.org or HomeAssitant, the FW is uploaded and a new node just popup!
Enjoy!
-
RE: FOTA/MYSBootloader - Documentation enhacement - Make it clear that you must program only the MYSBootloader, without sketch
@NeverDie I can give my thoughts here, and we can move it later to another thread if necessary.
The bigger selling points, at least for me:
- Every project is a self contained directory, even the boards configuration, bootloaders, libraries, code and build procedure
I have a project template for mysensors (mainly a platform.ini) that I copy for each node that I create. - I can manage everything with my known tools (vim, make, git, etc)
I like to play with arduino and electronics, but have other interests (Family, friends and 3 small kids...) so I usually have little time to spent in my hobbies. Platformio allows me to just have all the configuration in code and know 6 months ahead that I can do a "make clean && make upload" for a particular node without issues, even if I lost my PC, as everything is in my gitlab account.
Also the FW of my 3dprinter must be complied and uploaded with platformio (marlin 2.0) so I can have only one tool for both hobbies.
- Every project is a self contained directory, even the boards configuration, bootloaders, libraries, code and build procedure
Latest posts made by MatiasV
-
RE: API questions regarding Home Assistant Core.
@pw44 The HA integrations page has useful information of how it al works together, check the presentation paragraph as it is important in HA.
The node sketch shall make use of these defs for HA. Is it right?
So, on a node sensor, i can have from 0 to 255 child_id's, each with it's name. But how to give a name for each child, if more than one sensor is connected to the node?
The name can me customized in the presentation function in the description field:
https://www.mysensors.org/apidocs/group__MySensorsCoregrp.html#gaef20c35998db495bd4c85bac42a7ad49bool present ( const uint8_t sensorId, const mysensors_sensor_t sensorType, const char * description = "", const bool requestEcho = false )
Is this all right? if not, please educate me in the right way.
And i'm also getting the following:
This entity does not have a unique ID, therefore its settings cannot be managed from the UI.
Any hint?
This is a normal error in current versions of HA, the mysensors integration is still manual via YAML and cannot be managed from the HA FrontEnd.
-
RE: FOTA/MYSBootloader - Documentation enhacement - Make it clear that you must program only the MYSBootloader, without sketch
@NeverDie I can give my thoughts here, and we can move it later to another thread if necessary.
The bigger selling points, at least for me:
- Every project is a self contained directory, even the boards configuration, bootloaders, libraries, code and build procedure
I have a project template for mysensors (mainly a platform.ini) that I copy for each node that I create. - I can manage everything with my known tools (vim, make, git, etc)
I like to play with arduino and electronics, but have other interests (Family, friends and 3 small kids...) so I usually have little time to spent in my hobbies. Platformio allows me to just have all the configuration in code and know 6 months ahead that I can do a "make clean && make upload" for a particular node without issues, even if I lost my PC, as everything is in my gitlab account.
Also the FW of my 3dprinter must be complied and uploaded with platformio (marlin 2.0) so I can have only one tool for both hobbies.
- Every project is a self contained directory, even the boards configuration, bootloaders, libraries, code and build procedure
-
RE: Nodemanage + EasyPCB Sleep
@user2684 Did you experience any problems reading analog sensors that are powered via a transistor? I can not get reliable measurements from Capacitive Soil moisture Sensors when they are switched by a transistor.
-
RE: home Assistant and OTA support and node to node
@Joerideman said in home Assistant and OTA support and node to node:
@MatiasV BTW why did you switch to mqtt? The wifi GW accepts multiple connections.
I was experiencing problems when starting the HA "server" (AKA Old laptop) and GW, or while the WIFI was temporary off for any cause. We had some rough weeks with our electricity company.
The GW would disconnect from HA and I had to restart the GW or sometimes even HA to get it working again.
It was a mayor headache while I was out of the house, the MQTT GW is way more reliable for me. -
RE: Nodemanage + EasyPCB Sleep
@ElCheekytico, I was asking myself the same question about @user2684 approach.
For my power hungry sensors I'm experimenting using an 2n2222A Transistor with mixed success. (following this and that instructions ).
All works OK with sensors as DHT22 and similar digital devices, but I can't make it work with Analog sensors as an soil moisture sensor. I need to test, but I believe is because the voltage drop disturbing the AREF.
-
RE: home Assistant and OTA support and node to node
Hi @Joerideman! I'm using HA and FOTA. I'ts not integrated but If you move to a MQTT GW there is a workaround.
You can install mycontrolller.org only for FOTA, following this post instructions
I posted the result of my FOTA journey with my setup in this other thread.
BTW, moving from a WIFI GW to a MQTT GW was totally painless with HA, I just replaced the MySensors GW in HA configuration.yaml and every sensor was visible from HA. The only downside was that the node ID has to be manually assigned with MQTT and, if you was using AUTOID, all the sketches must be updated. The good news is that the ID lives in the EEPROM and survives reboots.
happy hacking.
-
FOTA/MYSBootloader - Documentation enhacement - Make it clear that you must program only the MYSBootloader, without sketch
Hi all,
I tried to get FOTA working two times before, and I was about to give up a third time as I had always the same problems:- After programming the MYSBootloader I loose the ability to do upload sketches via FTDI (with both pro-mini, nano's and barebones 328P)
- With MySController I could not upload any new FW, even a simple reboot command make the arduino to lock hard and it had to be powered down.
I tried the oficial github firmwares , the ones from GuilleBot I played with fuses, boards.txt, platformio.ini setting, different GWs, etc, etc, etc....
Last night I found this issue in github that gave me the detail that was missing. Just do not upload a sketch to the board, only program the MYSBootloader and wait until it asks the FW to the controller!Another source of confusion, at least for me, was that I did not knew what to expect of the whole process. What where the different steps and the expected duration of the upload. I will try to describe my setup and how I could finally get it working.
MySetup
- Controller: HomeAssistant
- GW:MQTT GW using ESP8266
- Portainer from the HomeAssistan AddOns
- MQTT from the HomeAssistan AddOns (mosquitto)
- FW Controller - MYCONTROLLER.ORG using MQTT GW.
Follow this post instructions
I installed it with docker in the same machine as HA using Portainer and cdrocker's image - Platformio.org for building sketches and programming bootloaders
Out of scope of this post, but way better than using Arduino. Totally worth the pain of learning it's basics. - A MQTT Gui to see what is happening between the node and the controller
I'm using MQTT EXplorer - An Arduino UNO as an ISP
- Sensors: A big mess of half working handmade boards, EasyPCB and SlimNode Sensors.
Steps
-
Get the correct MYSBootloader for your setup
Check GuilleBot repository if you are using another nfr24 channel or want to play with different radio power -
Modify boards.txt or your platformio.ini to add the bootloader
In my case, for the nano:
[platformio] default_envs = MYSBootloaderNano [env] platform = atmelavr framework = arduino upload_protocol = stk500v1 upload_port = /dev/ttyACM0 upload_speed = 19200 upload_flags = -v -e -P$UPLOAD_PORT -b$UPLOAD_SPEED lib_deps = MySensors MySensors NodeManager [env:MYSBootloaderNano] board = nanoatmega328new board_bootloader.file = bootloader/MYSBootloader_16MHz.hex
The important bits, the upload_flags specially the -e to erase the memory and the board_bootloader.file
- Program only the bootloader (and the fuses if necessary), for platformio:
$ platformio -f -c vim run --target bootloader
- Build the FW of your node, and copy the .hex somewhere on your PC. Again for platformio:
$ platformio -f -c vim run --target run
Look in .pio/build/<board>/
-
Add the FW to MyController.org following the product manual
-
Build your HW if needed, plug the radio, etc
-
Be sure to keep the MQTT Explorer and MyController.org to see some feedback of the whole process
-
Powerup the sensor
-
You will see a new node with ID 1 in MyController.org, if you look in "Status -> Resources logs" or in the MQTT Explorer you should see the node asking for a new FW.
-
In MyController.org assign the FW to the new node with ID 1 and upload it.
Check the manual if in doubt. -
You will see in MQTT Explorer that the controller and the node get very chatty. The node will ask for each piece of the HEX in small batches.
-
You have some time now, get up and make yourself a cup of coffee and prepare a small celebration.
-
Check the MQTT Explorer, the FW is still uploading... go and get some confetti.
-
Check Mycontroller.org or HomeAssitant, the FW is uploaded and a new node just popup!
Enjoy!
-
RE: Your workshop :)
I assumed that my desk was a kind of a mess... but now I realize it's just average!
-
RE: What did you build today (Pictures) ?
@monte Nice work! I love the looks of the concrete switches, do you have some links or useful information on how you did it.
I have a project of a doorbell that could use such a switch.Thanks!