New status update: IT WORKS!
I have to implement sleep and ATC, then I will upload it to GitHub for testing, if anyone is iterested...
Best posts made by eiten
-
RE: CubeCell HAL anyone?
-
RE: Gateway stops communicating (again)
Hm, maybe the problem is that your rPI has a short interruption in the WIFI connection, the MQTT TCP connection is interrupted and does not autostart again. Maybe there is something in the logs. Maybe you can find something about reconnects in one of these:
journalctl --unit=systemd-networkd journalctl --unit=wpa_supplicant
You could try to run wpa_cli in daemon mode to react to disconnects and connects. Create a script like this:
#!/bin/bash case "$2" in CONNECTED) <your command to start the gateway>; ;; DISCONNECTED) <your command to stop the gateway>; ;; esac
then, start
wpa_cli
in deamon mode:wpa_cli -a /path/to/your/script #use sudo if your gateway commands need sudo
If that helps, you could create a service from this command.
Regards, Edi
-
RE: CNC PCB milling
@NeverDie Did you check out the assembly instructions? There they use a fuse with a rather high current in this place
The explanation why it is polarized is because in fact, it used to be a diode in older revisions, check out Step 7 here. -
RE: FOTA using OptiBoot copy_flash_pages
IT WORKS
I got a first working version, using an ATmega1284P running on MightyCore 2.2.2 (as soon as I began developement, they switched from Optiboot to Urboot in version 3.0.0, whicht does not include the copy_flash_pages function anymore, but I'm working on a work around there).
Only thing I could not solve is to do a CRC check of the image after download...
You can try it out here: https://github.com/eiten/MySensors/tree/FOTAInternalFlashTest
It's not beautiful yet with much Serial.prints in it, but maybe it helps you if you find errors.
-
RE: Does a Bluetooth controller/gateway exist?
Hello Henrik,
In your scenario, I would not use a RPi. Maybe a ESP32 with BLE is already enough as a controler, if you don't need to log too much data or add an SD card. You could even combine two NRF52 (see below) and use one for BLE and the other for MySensors.
For your sensoirs, you could use a Keywish RF Nano or an NRF52 module like (this one)[https://www.aliexpress.com/item/32974237147.html] which combines a NRF24L01 and an ARM cortex M cpu and have very low sleep current.
Maybe it's best for you to use passive nodes when not using the RPi, so you don't have to care about address management and so on on the gateway.Regards, Edi
-
CubeCell reloaded: the SX126x hal drivers, please test
Hi everyone,
After the good comments by @Yveaux and @mfalkvidd in this thread i started over again. After some sleepless nights, a SSD-crash destroying about 12h of codingand tons of soft drinks, I just uploadated my github repository with the SX126x drivers and the ASR650x hal.
What is different to the things I mentioned in the thread above:- Everything is rebased to the developement branch as suggested by @mfalkvidd
- CubeCell hal byebye, welcome SX126x hal. As inspired by @Yveaux, I abandoned the CubeCell drivers in favor of SX126x drivers which should work on other SX126x based modules as well. Feel free to test. The code should work for the SX1261 as well as the SX1262, but as I only have CubeCell boards, only SX1262 is tested.
- ATM, I really dont feel like writing down all the defines, but everything is documented in
MyConfig.h
and in ```SX126x.h`` If you got questions. please ask.
During developement, I found another nasty bug in ASR650x Arduino regarding IRQ handling. You should take the latest version from ASR650x github if you encounter strange freezes on a CellCube board.
Have fun, I gotta get some sleep
-
RE: Node with only sendBatteryLevel into Home Assistant
Well, battery level is an attribute in Home Assistant, so you can only see it as a byproduct of a reading. Workaround is to open the persistence file, there, you can see the battery level even in no reading is shown in the frontend:
-
RE: Possible flaw in RFM95 driver
Oh sorry, my fault. It was a bit late. We have a return true in there, where we exit the loop as soon as we got an ack. You are right!
-
RE: 2x BME 280 on 2x arduino nano hangs in HomeAssistant
Hello @HJ_SK
Could you please post the whole sketch in code tags or as an attachement?
Does it work stable with just one sensor node?
Could you#define MY_DEBUG
, attach at least one sensor to a PC and post the log after they hang?Regards, Edi
-
RE: CubeCell HAL anyone?
Yes, exactly.
Well, I think we would have to write the HAL functions (which is not too hard as I imagine) as a first step. I hope we could use the RFM95 drivers in a first step, but the Framework compiles with a LoRa and a LoRaWAN app. If we have luck, we have no collisions.
In a further step, I would test if it is worth while to implement a new transport and use the native LoRa-stack.Well, I think I fork the github-repository and start to play around...
-
RE: [SOLVED] MySensors Raspberry Pi Gateway + Domotics Controller
@Eme did'nt I write English
So, if you look at the source:bool transportCheckUplink(const bool force) { if (!force && (hwMillis() - _transportSM.lastUplinkCheck) < MY_TRANSPORT_CHKUPL_INTERVAL_MS) { TRANSPORT_DEBUG(PSTR("TSF:CKU:OK,FCTRL\n")); // flood control return true; }
The transport prevented an uplink check, since the last was done less then
MY_TRANSPORT_CHKUPL_INTERVAL_MS
milliseconds ago (defaults to 10 seconds)
. -
Jenkin erros I do not understand
Can anybody help me? I made a pull request which results in Jenkin errors, I do not understand the output/what's wrong. Can anyone please help me out? It would be great to have the SX126x support, as I am working on the STM32WLE integration for MySensors.
Sorry, I forgot the link to the PR: https://github.com/mysensors/MySensors/pull/1547
-
RE: CNC PCB milling
@NeverDie and for reverse polarity protection, you could just use a FET, a resistor and a Zener (only necessary if reversed voltage is breaking the FET, which is cheaper if you have some amps and has loooots of less power dissipation:
I use this on all my PCBs with removable batterys. Luxury upgrade: a reverse voltage indicator:
Add a Zener parallel to the LED if you have a wide expectet input voltage range. -
RE: Gateways
@OldSurferDude well, the ESP8266 is limited to 4 TCP clients in arduino IDE. This can't be really increased. I did som experiments and you can set it up to 15, but after the 5th client on my web server, I got a freeze.
Maybe you got something wrong.
#define MY_GATEWAY_MAX_CLIENTS 2
defines how many controllers (eg Home Assistant) can connect to the gateway, not how many sensors/MySensors devices.And yes, you can have multiple TCP gateways in HomeAssistant. I got an NRF24, an RFM95 long range and a RFM95 short range gateway (all based on ESP32) on the same Home Assistant.
Regards, Edi
-
Heltec Cubecell support added. Please test!
So I added Cubecell support to the MySensors library. You can find it here. Feel free to test it if you have a CubeCell. It is (should be) fully compatible with RFM95, at least, I did the developement with an ESP32 RFM95 gateway. It works great together. However, I did not yet test signing.
Issues
There are some issues you have to be aware of. Most of them are out of my competence...- If you use Arduino IDE, you have to rename/delete
MyASM.S
I have no idea why Arduino IDE tries to compile this file. It seems to try to compile any *.S file in the lib directory, so maybe it's a fault in ASR650x Arduino - vsnprintf and Serial.flush are broken in ASR650x Arduino. Bug is reported. So debug output is sh... suboptimal.
The defines are:
#define MY_CUBECELL_RADIO #define MY_DEBUG_VERBOSE_CUBECELL #define MY_CUBECELL_TX_POWER_DBM //defaults to 13dBm, ATC is enabled #define MY_CUBECELL_FREQUENCY #define CUBECELL_169MHZ #define CUBECELL_315MHZ #define CUBECELL_434MHZ #define CUBECELL_868MHZ #define CUBECELL_915MHZ #define MY_CUBECELL_MODEM_CONFIGRUATION CUBECELL_BW125CR45SF128 //CUBECELL_BW500CR45SF128 and CUBECELL_BW125CR48SF4096 also supported
I would like if you give some feedback.
Regards, Edi
- If you use Arduino IDE, you have to rename/delete
-
RE: ATMEGA 328 Timer/Counter2 frequency problem
Hi Monte!
May you please post your sketch?
Thank you very much, edi
-
RE: CNC PCB milling
@NeverDie said in CNC PCB milling:
capacitors are to be used for that instead
Wow, thanks. I learned something today!
-
RE: Node with only sendBatteryLevel into Home Assistant
sensor: - platform: template sensors: greenhouse_battery: friendly_name: "Batterie Gewächshaus-Klimasensor" unit_of_measurement: "%" icon_template: mdi:battery unique_id: "greenhouse_battery" value_template: "{{ states.sensor.air_temperature.attributes.battery_level }}"
-
RE: Can not compile on Arduino Nano ESP 32
OK, so I suppose the build flags are incorrect. Do you use PlatformIO? Then, you could try:
build_flags = -D ARDUINO_USB_MODE=1 -D ARDUINO_USB_CDC_ON_BOOT=1
If you are on the Arduino IDE, you have to set
Tools -> USB-Mode -> CDC-Mode
. Ore something similar, I don't have the Arduino IDE installed ATM. IIRC, monitor speed must be set to 460800. -
RE: single-click, double-click, long-press button possible with MySensors?
hey @dirkc, maybe you can trigger your interrupt to rising and falling edge and use millis() to see how long the press was?
-
RE: Node with only sendBatteryLevel into Home Assistant
Hey Arno,
now it's getting a little bit complicated... as I have my HomeAssistant in German. Go to "Developement tools" (Entwicklerwerkzeuge), then to "States" (Zustände). There you can finde the name of your device.
-
RE: GatawayESP8266 - Compile error
Hi everyone
Which MySensors lib did you use? The 2.3.2 or the delevopment version? I tried to fix the errors, but they don't appear in the development branch. Only another error which i fixed.
Regards, Edi