@nca78 well, after 2 nights of intense trying and failing I've got code to work as expected. And yes, it works with PORT interrupt, its kinda more code for you to write in compare to simply using attachInterrupt function, but I'm okay with that. For me double the price of 52832 compared to 51822 is significant. And for now, for a simple sensor stuff as we do with mysensors I don't really see any advantages except that interrupt bug fixed.
Also I've found that Mysensors sleep function for nrf5 is missing one very important command, I don't know why, maybe it is nrf51822 specific and thus @d00616 missed it but in current version of Mysensors library it doesn't disable UART before sleep, that's why I was getting 120-200uA current during sleep. I still don't really know how to make pull requests on github, so I guess I will just post it here:
line 290 of MyHwNRF5.cpp should contain: NRF_UART0->ENABLE=0;
and line 327: NRF_UART0->ENABLE=1;
respectively. That completely disables UART on nrf51822.
I will post my complete sketch later, when I will finish it, maybe someone who strugles as I did will find it useful. Also I think we need to somehow combine all examples that were posted in this thread or at least put a list of them with links, because looking through 1654 posts is not an easy task, especially if you not sure what you are looking for exactly.
Best posts made by monte
-
RE: nRF5 action!
-
RE: What did you build today (Pictures) ?
Made a prototype board for writing a software for one of my projects. Goal was to have everything needed on a board no bigger then a 1.54" eink display, and to make it doable at home by my own.
I was gladly surprised that everything worked (after a sleepless night of fighting through-layer connections, and soldering/desoldering FPC connectors) The only I've messed up is order of connector pins, so the display is connected the wrong way...
It also has pads for SHT30 sensor so it may be somehow useful after development is done.
-
RE: Where did everyone go?
I guess the main reason is that mysensors is very stand-alone framework. And it locked itself in purely hobbyist territory. So when there are vast amount of iot devices from various manufacturers that you can combine with your own diy solutions in zigbee-ikea-hue or esp-tasmota-mqtt ecosystem in mysesnsors you have to make all devices yourself if you want some kind of ecosystem, or rely on HA/openhab/nodered/domoticz with its script system to make something connected. Also strict requirement of arduino framework and outdated hardware as the core of the framework alienates the big chunk of iot developers out there. It feels like people come to mysensors, make relay node, temperature sensor and then go forward for more complex solutions to never come back.
@NeverDie said in Where did everyone go?:
not all that long ago Google bought a thermostat company (Nest)
And pretty much broke it for opensource or third-party integrations.
-
RE: What did you build today (Pictures) ?
Build myself a simple temperature sensor with a clock. No RTC, just pulling time from controller and updating every 10 minutes to avoid drift. Also requesting outdoor temperature from controller. Build from what was lying around - DHT22, pro mini clone, nokia screen. I can share the code if someone needs it
-
RE: What did you build today (Pictures) ?
Offtopic in terms of mysensors platform, but somehow tangent to a home automation. I've made a batch of concrete switches/push buttons which are in this case simple buttons with led backlight and all the logic is located centrally in distribution box, based on KNX ABB module. But I am planning on making smarter and more complex version which could use Mysensors as its transport.
and a photo of insides of one of the prototypes at first stages of development
-
RE: What did you build today (Pictures) ?
Today I've finally swapped my outdoor relay node with something descent.
This was my very first mysensors node that I've built when I was only starting to mess with arduino, probably around four years ago.
This board uses cheap 5v power supply and an amplified version of NRF24 module from Ebyte. It supposed to be poured with silicone ore resin, but I am yet to find suitable box, the size of this board appeared to be bigger then most of such cases designed for compound pouring. But I'm planning on making next version, with non-isolated power supply, which will help to achieve smaller size. -
RE: What did you build today (Pictures) ?
From left to right:- Home Assistant server with built-in NRF24 radio and OLED display based on Orange Pi Zero
- MQTT Mysensors gateway with ESP8285
- 4 channel triac dimmer with oled display and UI for operating in standalone mode.
-
Direct pairing of two nodes implementation
I've been looking for some time for implementation of pairing two nodes to each other to be able to send messages directly omitting controller. I've seen some other posts suggesting to add this functionality to mysensors core, and proposing base scheme of how it should look like. After some reading I realized that it is not hard to write such code by myself. So I tried my best and now I have what seems to be a working code for two test nodes and a gateway. One of the nodes is modified sketch for binary button the other one is simple one channel relay. I'm not a professional programmer, so code can be optimized more, I guess, and maybe rewritten in better manner.
It's primarily useful for direct communication between a button node (a light switch, or motion sensor) and some relay or other actuator. The key feature is the ability to avoid necessity of controller presence for some simple usage like light switching. Also it provides better reliability in case of controller failure.
Both nodes must have specific pairing button which also serves as "Clear EEPROM" button if pressed before node is powered on. So basically when pairing button is pressed node enters pairing mode for required amount of time (in my case 10 seconds) and sends special message to controller which collects its node and children id's and then waits for 10 seconds for another node to send request in which case it then sends id's vice versa. My code is written only for single button/relay nodes, but it can be made to pair specific child sensors on every node.
Let me know what do you think of it, and if it's useful to anybody.
Binary button code:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 #include <MySensors.h> #define CHILD_ID 3 #define SET_BUTTON_PIN 5// Arduino Digital I/O pin for button/reed switch #define BUTTON_PIN 3 MyMessage msg(CHILD_ID, V_TRIPPED); bool firstLoop = 1; bool pairing = 0; int node_pair=-1; int sensor_pair=-1; bool paired=0; bool lastButState=0; unsigned long timer1 = 0; int debounceTime = 1000; unsigned long timer2 = 0; int pairWaitTime = 10000; unsigned long timer3; int holdTime = 3000; //Time counter function instead of delay boolean isTime(unsigned long *timeMark, unsigned long timeInterval) { if (millis() - *timeMark >= timeInterval) { *timeMark = millis(); return true; } return false; } void before() { Serial.begin(115200); Serial.println("Starting node..."); pinMode(SET_BUTTON_PIN, INPUT_PULLUP); //Eneble button pin for detect request for resetting node's EEPROM bool clr = digitalRead(SET_BUTTON_PIN); if (!clr) { Serial.println("Clearing EEPROM"); for (int i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) { hwWriteConfig(i,0xFF); } //Clearing paired nodes address and paired state for (int i=245; i<=255; i++) { hwWriteConfig(i,0xFF); } Serial.println("EEPROM is clean"); } //Reading pairing state from EEPROM and then reading paired nodes id's if paired paired = loadState(255); Serial.print("Paired state: "); Serial.println(paired); if (paired) { node_pair = loadState(245); sensor_pair = loadState(246); Serial.print("Paired node: "); Serial.print(node_pair); Serial.print("-"); Serial.println(sensor_pair); } } void setup() { // Setup the buttons pinMode(BUTTON_PIN, INPUT_PULLUP); } void presentation() { // Send the sketch version information to the Controller in case node is'nt paired if (!paired) { sendSketchInfo("Binary paired button", "1.0"); present(CHILD_ID, S_MOTION); } } // Loop will iterate on changes on the BUTTON_PINs void loop() { bool butState = !digitalRead(BUTTON_PIN); if (!paired) { if (firstLoop) { timer3 = millis(); //Starting delay for pairing button on first loop } //If pairing button hold for required amount of seconds initiate pairing process if (!digitalRead(SET_BUTTON_PIN)) { if(isTime(&timer3, holdTime)){ Serial.println("Pair button pressed"); pair(); if (!paired) { Serial.println("Pairing timeout"); } } } else { timer3 = millis(); } } //Processing main button press if (butState != lastButState) { if (butState) { lastButState = butState; if (isTime(&timer1, debounceTime)) { Serial.println("Button pressed"); //If node is paired to other node send message directly to paired node omitting controller if (paired) { MyMessage msg(sensor_pair, V_TRIPPED); msg.setDestination(node_pair); Serial.println("Sent message to paired node"); int retry = 0; while(!send(msg.set(1)) || retry == 10) { wait(100); send(msg.set(1)); retry++; } } else { //If not, send message to controller send(msg.set(1)); Serial.println("Sent message to controller"); } } } else { if (!paired) { send(msg.set(0)); } lastButState = butState; } } firstLoop = 0; //Counter for first loop just to know from where to start timer for pairing button hold } //Pairing function void pair() { Serial.println("Entering pairing mode"); pairing = 1; MyMessage pairMsg(244, V_VAR1); //I'm using specific CHILD_ID to be able to filter out pairing requests send(pairMsg.set("Pair me."), true); //Send any message to gateway Serial.println("Pair request sent"); //Then we wait some time to recieve paired node id (in my case 10 seconds) timer2 = millis(); while (!isTime(&timer2, pairWaitTime)) { wait(1); if (paired) { Serial.println("Successfully paired"); break; } } pairing = 0; } void receive(const MyMessage &message) { //While in pairing mode we'll only process pairing messages if (pairing) { if (!message.sender) { if (message.type == V_VAR2) { node_pair = atoi(strtok(message.getString(), ";")); //Deconstructing string from gateway, wich must contain id of paired node Serial.println(node_pair); sensor_pair = atoi(strtok(NULL, ";")); //...and id of specific sensor on that node, in case there are more than one Serial.print("Paired with: "); Serial.println(node_pair); Serial.println(sensor_pair); paired=1; saveState(255, 1); } } } }
Relay actuator code:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Enable repeater functionality for this node //#define MY_REPEATER_FEATURE #include <MySensors.h> #define CHILD_ID 1 #define RELAY_PIN 5 // Arduino Digital I/O pin number for relay #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay #define SET_BUTTON_PIN 3 bool relayState; bool firstLoop = 1; bool pairing = 0; int node_pair=-1; int sensor_pair=-1; bool paired=0; bool lastButState=0; unsigned long timer1 = 0; int debounceTime = 100; unsigned long timer2 = 0; int pairWaitTime = 10000; unsigned long timer3; int holdTime = 3000; unsigned long timer4; int resendTime = 1500; MyMessage msg(CHILD_ID,V_LIGHT); //Time counter function instead delay boolean isTime(unsigned long *timeMark, unsigned long timeInterval) { if (millis() - *timeMark >= timeInterval) { *timeMark = millis(); return true; } return false; } void before () { Serial.begin(115200); Serial.println("Starting..."); pinMode(SET_BUTTON_PIN, INPUT_PULLUP); bool clr = digitalRead(SET_BUTTON_PIN); if (!clr) { Serial.println("Clearing EEPROM"); for (int i=0; i<EEPROM_LOCAL_CONFIG_ADDRESS; i++) { hwWriteConfig(i,0xFF); } //Clearing paired nodes address and paired state for (int i=245; i<=255; i++) { hwWriteConfig(i,0xFF); } Serial.println("EEPROM is clean"); } //Reading pairing state from EEPROM and then reading paired nodes id's if paired paired = loadState(255); Serial.print("Paired state: "); Serial.println(paired); if (paired) { node_pair = loadState(245); sensor_pair = loadState(246); Serial.print("Paired node: "); Serial.print(node_pair); Serial.print("-"); Serial.println(sensor_pair); } pinMode(RELAY_PIN, OUTPUT); digitalWrite(RELAY_PIN, 1); delay(1000); digitalWrite(RELAY_PIN, 0); // Set relay to last known state (using eeprom storage) relayState = loadState(CHILD_ID); digitalWrite(RELAY_PIN, relayState ? RELAY_ON : RELAY_OFF); } void setup() { } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay", "1.0"); present(CHILD_ID, S_LIGHT, "Test light", true); // Send saved state to gateway (using eeprom storage) send(msg.set(relayState),true); } void loop() { if (!paired) { if (firstLoop) { timer3 = millis(); //Starting delay for pairing button on first loop } //If pairing button hold for required amount of seconds initiate pairing process if (!digitalRead(SET_BUTTON_PIN)) { if(isTime(&timer3, holdTime)){ Serial.println("Pair button pressed"); pair(); } } else { timer3 = millis(); } } firstLoop = 0; //Counter for first loop just to know from where to start timer for pairing button hold } void pair() { Serial.println("Entering pairing mode"); pairing = 1; MyMessage pairMsg(244, V_VAR1); //I'm using specific CHILD_ID to be able to filter out pairing requests send(pairMsg.set("Pair me."), true); //Send any message to gateway Serial.println("Pair request sent"); //Then we wait some time to recieve paired node id (in my case 10 seconds) timer2 = millis(); while (!isTime(&timer2, pairWaitTime)) { wait(1); if (paired) { Serial.println("Successfully paired"); break; } } pairing = 0; Serial.println("Pairing timeout"); } void receive(const MyMessage &message) { //While in pairing mode we'll only process pairing messages if (pairing) { if (!message.sender) { if (message.type == V_VAR2) { node_pair = atoi(strtok(message.getString(), ";")); //Deconstructing string from gateway, wich must contain id of paired node Serial.println(node_pair); sensor_pair = atoi(strtok(NULL, ";")); //...and id of specific sensor on that node, in case there are more than one Serial.print("Paired with: "); Serial.println(node_pair); Serial.println(sensor_pair); paired=1; saveState(255, 1); } } } else { //Process mesage from gateway if (message.type == V_LIGHT && !message.sender) { // Change relay state relayState = message.getBool(); digitalWrite(RELAY_PIN, relayState ? RELAY_ON : RELAY_OFF); // Store state in eeprom saveState(CHILD_ID, relayState); // Write some debug info Serial.print("Incoming change. New status:"); Serial.println(relayState); } else if (message.type == V_TRIPPED && message.sender == node_pair) { //Process message sent directly from paired node if(isTime(&timer4, resendTime)) { digitalWrite(RELAY_PIN, relayState ? RELAY_OFF : RELAY_ON); relayState = relayState ? 0 : 1; saveState(CHILD_ID, relayState); send(msg.set(relayState)); //Send changed state to controller, because paired button won't do it } } } }
Gateway code:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Set LOW transmit power level as default, if you have an amplified NRF-module and // power your radio separately with a good regulator you can turn up PA level. #define MY_RF24_PA_LEVEL RF24_PA_MAX // Enable serial gateway #define MY_GATEWAY_SERIAL // Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender) #if F_CPU == 8000000L #define MY_BAUD_RATE 38400 #endif // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 #include <MySensors.h> unsigned long currentTime = 0; int waitTime = 10000; int node1_addr = 0; bool node1_addr_present = 0; int sensor1_addr = 0; char str1[8]; char str2[8]; bool pairing = 0; //Messages for answering pairing requests MyMessage msg(254,V_VAR2); MyMessage msg2(254,V_VAR2); //Time counter function instead delay boolean isTime(unsigned long *timeMark, unsigned long timeInterval) { if (millis() - *timeMark >= timeInterval) { *timeMark = millis(); return true; } return false; } void setup() { // Setup locally attached sensors } void loop() { //We are keeping ids of pairing nodes only for 10 seconds while pairing if(isTime(¤tTime, waitTime)) { node1_addr = 0; node1_addr_present = 0; } } void receive(const MyMessage &message) { //I used specific message type for filtering out pairing request if (message.type == V_VAR1) { Serial.print("Incoming message. Node - "); Serial.print(message.sender); Serial.print(message.sensor); Serial.println(message.getString()); //Check if there was any pairing requests for last 10 seconds, if no begin pairing process if (!node1_addr_present) { currentTime = millis(); node1_addr = message.sender; sensor1_addr = message.sensor; node1_addr_present = 1; } //If there is request from another node send back pairing node ids to each other else if (message.sender != node1_addr && message.sensor != sensor1_addr) { snprintf(str2, 7, "%d;%d", message.sender, message.sensor); //Construct message string with node and sensor ids of second node snprintf(str1, 7, "%d;%d", node1_addr, sensor1_addr); //...and the first one //print some debug info Serial.print("First address: "); Serial.print(str1); Serial.print("Second address: "); Serial.print(str2); //Send answer to nodes msg.setDestination(message.sender); send(msg.set(str1), true); wait(500); Serial.println("Sent message to second address"); msg2.setDestination(node1_addr); send(msg2.set(str2), true); wait(500); Serial.println("Sent message to first address"); node1_addr = 0; sensor1_addr = 0; node1_addr_present = 0; Serial.println("Pairing finished"); } } }
-
RE: Favorite hand solderable radio chip?
@NeverDie stencil would help, for sure. But I am talking bare minimum. You tin the pads a little, so they are like bumps, then apply gel flux, put the IC aligned to the pins and reflow it with hot-air gun. That may be not the best practice, but it works, if you need to solder few IC's.
-
RE: nRF5 action!
I wanted to write that Softdevice and ESB are not compatible for use at the same time, but then decided to fact check myself. Seems like now you can use Softdevice and ESB simultaneously. You can either disable softdevice in program, or use Timeslot API to manage access to radio of different protocols.
https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsds_s140%2FSDS%2Fs1xx%2Fconcurrent_multiprotocol_tsl_api%2Ftsl_usage_examples.html&cp=4_5_3_0_8_2
https://devzone.nordicsemi.com/f/nordic-q-a/55847/priority-level-overlap-between-softdevice-and-esb
https://jimmywongiot.com/2020/06/22/radio-timeslot-api-for-the-multiple-protocols/
If this is doable I can't think of a reason, why mysensors shouldn't use softdevice. -
RE: What did you build today (Pictures) ?
@sundberg84 I've bought these 5032 crystals: https://www.aliexpress.com/item/Free-shipping-20pcs-16-000MHZ-16mhz-20pF-2Pin-5032-smd-quartz-resonator-Crystal/32821974003.html but there are plentiful other offers on aliexspress and/or ebay. This 5032 package seems to be the most common. There is another package with the same size but with 4 pins 2 of which are not connected, I bought them from my local distributor, while was waiting a package from aliexpress. But those with 4 pins are harder to solder (obviously) and I don't see any pros of using them.
The most suitable for hand soldering and easiest to find are these:
According to this image the ones I have are TX5 and TG5. -
ESP8266 MQTT gateway SSL connection
There are couple old topics on this forum about secure connection to external MQTT broker, but neither of solutions described there aren't working now. Not so long ago the pull request was added on PubSubClient github which provides SSL connection code available only for esp8266: https://github.com/knolleary/pubsubclient/pull/251. It isn't merged yet, but you can manually install proposed patch from here https://github.com/knolleary/pubsubclient/pull/251/commits/bc9995ba2f7d0a42959685bdae51a014e03514bd.
Another thing you have to do is to modify MyGatewayTransportMQTTClient.cpp in /core folder of your MySensors library. I hope soon someone will make changes to source code, so it won't be necessary.I'm not experienced programmer, so i guess there has to be a better way to add changes to this code, but this way it works at least :
/* * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2016 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. */ // Topic structure: MY_MQTT_PUBLISH_TOPIC_PREFIX/NODE-ID/SENSOR-ID/CMD-TYPE/ACK-FLAG/SUB-TYPE #include "MyGatewayTransport.h" #if defined MY_CONTROLLER_IP_ADDRESS IPAddress _brokerIp(MY_CONTROLLER_IP_ADDRESS); #endif #if defined(MY_GATEWAY_ESP8266) #define EthernetClient WiFiClient #if defined(MY_IP_ADDRESS) IPAddress _gatewayIp(MY_IP_GATEWAY_ADDRESS); IPAddress _subnetIp(MY_IP_SUBNET_ADDRESS); #endif #elif defined(MY_GATEWAY_LINUX) // Nothing to do here #elif defined(MY_GATEWAY_ESP8266_SECURE) #define EthernetClient WiFiClientSecure #else uint8_t _MQTT_clientMAC[] = { MY_MAC_ADDRESS }; #endif #if defined(MY_IP_ADDRESS) IPAddress _MQTT_clientIp(MY_IP_ADDRESS); #endif #if defined(MY_SSL_FINGERPRINT) const char* fingerprint = MY_SSL_FINGERPRINT; #endif static EthernetClient _MQTT_ethClient; #if defined(MY_GATEWAY_ESP8266_SECURE) static PubSubClient _MQTT_client(_MQTT_ethClient, fingerprint); #else static PubSubClient _MQTT_client(_MQTT_ethClient); #endif static bool _MQTT_connecting = true; static bool _MQTT_available = false; static MyMessage _MQTT_msg; bool gatewayTransportSend(MyMessage &message) { if (!_MQTT_client.connected()) { return false; } setIndication(INDICATION_GW_TX); char *topic = protocolFormatMQTTTopic(MY_MQTT_PUBLISH_TOPIC_PREFIX, message); debug(PSTR("Sending message on topic: %s\n"), topic); return _MQTT_client.publish(topic, message.getString(_convBuffer)); } void incomingMQTT(char* topic, uint8_t* payload, unsigned int length) { debug(PSTR("Message arrived on topic: %s\n"), topic); _MQTT_available = protocolMQTTParse(_MQTT_msg, topic, payload, length); } bool reconnectMQTT(void) { debug(PSTR("Attempting MQTT connection...\n")); // Attempt to connect if (_MQTT_client.connect(MY_MQTT_CLIENT_ID #if defined(MY_MQTT_USER) && defined(MY_MQTT_PASSWORD) , MY_MQTT_USER, MY_MQTT_PASSWORD #endif )) { debug(PSTR("MQTT connected\n")); // Send presentation of locally attached sensors (and node if applicable) presentNode(); // Once connected, publish an announcement... //_MQTT_client.publish("outTopic","hello world"); // ... and resubscribe _MQTT_client.subscribe(MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "/+/+/+/+/+"); return true; } return false; } bool gatewayTransportConnect(void) { #if defined(MY_GATEWAY_ESP8266) while (WiFi.status() != WL_CONNECTED) { wait(500); MY_SERIALDEVICE.print(F(".")); } MY_SERIALDEVICE.print(F("IP: ")); MY_SERIALDEVICE.println(WiFi.localIP()); #elif defined(MY_GATEWAY_ESP8266_SECURE) while (WiFi.status() != WL_CONNECTED) { wait(500); MY_SERIALDEVICE.print(F(".")); } MY_SERIALDEVICE.print(F("IP: ")); MY_SERIALDEVICE.println(WiFi.localIP()); #elif defined(MY_GATEWAY_LINUX) #if defined(MY_IP_ADDRESS) //TODO #endif #else #ifdef MY_IP_ADDRESS Ethernet.begin(_MQTT_clientMAC, _MQTT_clientIp); #else // Get IP address from DHCP if (!Ethernet.begin(_MQTT_clientMAC)) { MY_SERIALDEVICE.print(F("DHCP FAILURE...")); _MQTT_connecting = false; return false; } #endif MY_SERIALDEVICE.print(F("IP: ")); MY_SERIALDEVICE.println(Ethernet.localIP()); // give the Ethernet interface a second to initialize delay(1000); #endif return true; } bool gatewayTransportInit(void) { _MQTT_connecting = true; #if defined(MY_CONTROLLER_IP_ADDRESS) _MQTT_client.setServer(_brokerIp, MY_PORT); #else _MQTT_client.setServer(MY_CONTROLLER_URL_ADDRESS, MY_PORT); #endif _MQTT_client.setCallback(incomingMQTT); #if defined(MY_GATEWAY_ESP8266) // Turn off access point WiFi.mode(WIFI_STA); #if defined(MY_ESP8266_HOSTNAME) WiFi.hostname(MY_ESP8266_HOSTNAME); #endif (void)WiFi.begin(MY_ESP8266_SSID, MY_ESP8266_PASSWORD); #ifdef MY_IP_ADDRESS WiFi.config(_MQTT_clientIp, _gatewayIp, _subnetIp); #endif #endif gatewayTransportConnect(); _MQTT_connecting = false; return true; } bool gatewayTransportAvailable(void) { if (_MQTT_connecting) { return false; } //keep lease on dhcp address //Ethernet.maintain(); if (!_MQTT_client.connected()) { //reinitialise client if (gatewayTransportConnect()) { reconnectMQTT(); } return false; } _MQTT_client.loop(); return _MQTT_available; } MyMessage & gatewayTransportReceive(void) { // Return the last parsed message _MQTT_available = false; return _MQTT_msg; }
So i added definition of MY_GATEWAY_ESP8266_SECURE option because we need to use WiFiClientSecure method for connection for SSL to work. Also we'll need SSL fingerprint of your MQTT broker, so you'll need to define this option in the code of your gateway. Else changes are duplicating code for MY_GATEWAY_ESP8266 to accommodate new option.
// Enable debug prints to serial monitor #define MY_DEBUG // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h #define MY_BAUD_RATE 9600 // Enables and select radio type (if attached) #define MY_RADIO_NRF24 #define MY_GATEWAY_MQTT_CLIENT #define MY_GATEWAY_ESP8266_SECURE // Set this node's subscribe and publish topic prefix #define MY_MQTT_PUBLISH_TOPIC_PREFIX "mygateway1-out" #define MY_MQTT_SUBSCRIBE_TOPIC_PREFIX "mygateway1-in" // Set MQTT client id #define MY_MQTT_CLIENT_ID "mysensors-1" // Enable these if your MQTT broker requires usenrame/password #define MY_MQTT_USER "user" #define MY_MQTT_PASSWORD "password" // Set WIFI SSID and password #define MY_ESP8266_SSID "ssid" #define MY_ESP8266_PASSWORD "Wi-Fi password" // Set the hostname for the WiFi Client. This is the hostname // it will pass to the DHCP server if not static. // #define MY_ESP8266_HOSTNAME "mqtt-sensor-gateway" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) //#define MY_IP_ADDRESS 192,168,2,197 // If using static ip you need to define Gateway and Subnet address as well //#define MY_IP_GATEWAY_ADDRESS 192,168,2,1 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0 // MQTT broker ip address. #define MY_CONTROLLER_URL_ADDRESS "URL of your MQTT broker" // The MQTT broker port to to open #define MY_PORT SSL-port #define MY_SSL_FINGERPRINT "ssl fingerprint of your MQTT broker" #include <ESP8266WiFi.h> #include <MySensors.h> void setup() { } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attech sensors data here }
Let me know what do you think about it.
-
RE: Where did everyone go?
@NeverDie I am just paranoid about relying on a cloud for everything. What if, lets say, my internet connection is cut off, or theirs or they decide to close the API (like google did to nest). I don't like my data taking such a long detour. That's why I installed nextcloud at home when dropbox decided they didn't need to support anything except ext4 on linux
-
RE: Best PC platform for running Esxi/Docker at home?
+1 for proxmox. Didn't have good experience with esxi. Proxmox is opensource, free and debian-based. Using it on HP microserver gen 8.
As for CPU choice I don't see how there would be any issue with Ryzen. All you need from processor is hardware virtualization, and I think all except the lowest level ones have it nowadays. -
Control temperature of double white LED stripes
Now you can buy LED stripes with dual white LEDs. It's half cold half warm, it has 3 pins: V+, V- for cold LED and V- for warm LED. That way by dimming each led you can control the overall color temperature of the light.
This LEDs are used extensively by IKEA in their lamps. Home assistant has separate control for color temperature, so when you connect IKEA hub to it you can control lamp's warmth.
I haven't found suitable message type in Mysensor's API. Is there any way to implement this feature? Or maybe there is some workaround to do this with current API? -
RE: What did you build today (Pictures) ?
@neverdie you can use this and this as a reference. No need to buy ready breakout board, if you know how to trace your own.
-
RE: Everything nRF52840
@scalz haven't you noticed that mysensors' community which is represented mostly by this forum has become more than just an arduino library? People share on this forum many projects that has only mediate connection to mysensors, if any. And many of users of the library in it's current form have outgrowing some of it's limitations, so naturally they will try to find a solution to overcome them and then share with others on this forum. I don't see nothing wrong for mysensors platform to evolve and adopt modern standards and/or protocols. And even if 15.4 is not suitable or just a replacement of mysensors protocol I think there are people here that will find it useful to read about it. Correct me if I'm wrong but there is no rule against discussing other protocols than mysensors on this forum.
-
RE: nRF5 action!
@omemanti It seems like some peripherals are not shut down before sleep. As library you've mentioned uses Wire library, it must be TWI (i2c) interface that are active during sleep and consumes extra power. I'm afraid that you will have to manually disable/enable TWI around sleep routine.
EDIT: I see you've found an answer by yourself. Just want to clarify that it isn't nrf5 chip's fault, it just how it intended to work. It doesn't automagically disable all peripherals during sleep. So, someone should write low current sleep library for nrf5 specifically, that will check the state of peripherals before sleep and disable them if needed. -
RE: Modular sketch to be configured with JSON (idea)
@boozz yes, exactly I had this in mind, but with specifics of Mysensors framework. Not everyone wants to rely on WiFi with their home automation.
@mtiutiu I mentioned JSON because I've used JSON library for Arduino and know that it exists, it well may be YAML if it's more suitable.
@user2684 said in Modular sketch to be configured with JSON (idea):
BUT this is defined at compilation time not at runtime as you are suggesting. Reason is simple: since there are 60+ ready-to-use sensors in NodeManager, accommodating everything especially in a small arduino is not feasible, also considering the dependencies some sensors bring in. I see usually up to 3-4 sensors can fit the flash, no more. But I expect in different environments the situation could be different or at least for a subset of those.
We are talking about nRF52 use case, which has abundance of available flash space. And my thought was a bit different then you described.
Imagine you have base firmwares for most sensor types, or it can be generated with NodeManager. But key parameters are configured with externally loaded JSON (or YAML) file, so it can be modified after flashing initial firmware.
I'm not completely sure how much use does this solution has, that's why I started discussion here, to see if anyone thinks it would be a good idea.
Thanks for your reply -
RE: What did you build today (Pictures) ?
@berkseo thanks for mentioning that. But as I understand the change in software would be just including another header file, if I'm using GxEPD library. There is a mention on github that there is GDEH0154D67 model as a replacement for GDEP015OC. Or do you mean that they are discontinuing 1.54" displays completely?
-
RE: Everything nRF52840
@neverdie YAY for transport-agnostic mysensors-python-edition!
-
RE: Cross compile mysensors gateway
@Jasper-van-Zuijlen well, it took 6 minutes to compile on my Raspberry 1 B+, so no big deal, but if you will achieve cross compiling, I think documenting it here will be much appreciated
-
RE: stm32 sleep support
@rozpruwacz one answer would be "Are you yourself willing to work on this stuff?" Being community project means that people from this community maintain the code and add functionality. So basically the most interested in some function member will write it and the rest may help to improve it.
-
RE: Where did everyone go?
Ah, nice, now you can turn on and off wifi sockets and other wifi based iot without even knowing password to the wifi! Great!
https://www.fragattacks.com/ -
RE: Just found a pair of "old" NRF51822-04 ... any good?
@ghiglie look at this from the point that the more difficult the task the more you will learn by accomplishing it
-
RE: How to drill 1mm diameter holes? My drills won't even hold the bit!
@NeverDie https://www.aliexpress.com/item/32738503593.html special bits, that has the same diameter of the tail side, and will fit the standard drill. Or you can buy a drill with small jaws, or just another chuck, that will fit your drill.
I am using dremel tool with a drill chuck bought separately https://www.dremel.com/us/en/p/4486-2615004486 -
RE: Favorite hand solderable radio chip?
@NeverDie I would say that many more chips (such as nrf24, nrf52832 and others in QFN package) become easily hand-solderable if you buy 20-30$ hot-air gun.
-
Interactive KiCAD BoM
It looks like that could be a great addition to everyone's workflow. Could it be somehow integrated with openhardware.io bom section? https://hackaday.com/2018/09/04/interactive-kicad-boms-make-hand-assembly-a-breeze/
What do you think guys? -
RE: Best choise for a controller
@neverdie but isn't Docker more efficient and simple solution compared to a VM? Considering it will be used for single process anyway.
I have a combination of VM's, Docker and dedicated RPi's in my system and I learned that Docker has very little overhead compared to VM and has greater flexibility when it comes to backups, restores especially if there is ready to use image in the repository. -
RE: easy FPGA'S
I have same questions as some guys in the comment section of that video. I know what FPGA is, but I can't understand what is the use scenario for those who are using MCU's for their projects. And as we are on mysensors forum, maybe you have in mind some application for FPGA to our common needs? I can't imagine myself starting to learn verilog right now, but I hear about it from all around so I might consider learning it in near future, but I can't make myself learn stuff unless I see some interesting application of new knowledge.
-
RE: Nrf24l01 with router antenna
@soloam from my experience NRF24L01 PA LNA has SMA connector and typical router antennas have RP-SMA connector. The difference between them is that one of them has center pin on female and other on male side. I had to resolder connector from a spare PCI wi-fi card to connect router antenna. For next gateway I want to try this module with IPX connector https://www.aliexpress.com/item/1PC-New-Arrival-100mW-AS01-SPIPX-nRF24L01-wireless-pa-lna-2-4g-wifi-module-Wireless-Transmission/32819372747.html you will ned to buy a "pigtail" to connect it to standard antenna, but in my opinion it is more useful if you need to mount antenna outside of some sort of case for better receiving.
-
RE: Protecting a lock switch securely with MySensors and Domoticz
@sushukka thats good. But i didn't mean that someone would guess your ip/port by hands. There are different network scanners, for example nmap. Once you are on your local network you can know every ip and opened port without guessing.
-
RE: Best PC platform for running Esxi/Docker at home?
@NeverDie said in Best PC platform for running Esxi/Docker at home?:
It seems that a minimum of 3 disks is required for running ProxMox: one to boot from, one for ISO's, and one for VM's. I'm surprised it's that literal and not able to partition one disk into 3 equivalent disks. It advises not to use a USB flash for the boot disk.
Not true. I have 1 SSD running proxmox. And two more disks passed trough to vm's for storage, but the proxmox part is entirely on the small SSD. It is just partitioned using LVM.
-
RE: What did you build today (Pictures) ?
@acb have you written a bootloader yourself, or found already available? Can you tell more about it and a board you using to connect nrf52 to FTDI?
Nice work! -
RE: Everything nRF52840
@neverdie why won't you use Nordic's native SDK with Eclipse? I found some tutorials how to set it up, so I guess it's an option.
-
RE: Domoticz TEXT sensor triggering
@sushukka I'm using Domoticz myself at home, but have chosen OpenHAB as a platform for my friend's home automation project I'm working on. We are using some KNX modules and for now only openhab has native support for it (among platforms that are kept developing). Another big advantage of openhab is number of different bindings for different hardware and community that is willing to write the new ones. On the other hand developers of Domoticz either ignore your suggestions or tell you to implement them yourself. Can't see a bright future with such an attitude.
-
RE: Best PC platform for running Esxi/Docker at home?
@NeverDie expand
host000
item in the list on the left. Choose storagelocal
at the end of the list, chooseISO Images
, hitUpload
.
Then press create VM on the top right of the GUI. -
RE: Everything nRF52840
@neverdie I've read about this standard after reading nrf52 page on nordic's site. Please keep posting if it is not difficult for you. I think some time in the future many of current members of mysensors community will look at nrf51/52 MCU's as a replacement and further development of the platform. Seeing someone like you digging deep into the cause will encourage others.
-
RE: How to start using a Pro Mini?
@eddiever said in How to start using a Pro Mini?:
Pro Mini atmega168 3.3V 8M Compatible Nano Replace Atmega328 For Arduino
You didn't provide links to what exactly you've bought, but as I understand your boards are some kind of ProMini clones. Note that they don't have serial converter on board for connection with PC. To upload sketches to these boards you will need USB to Serial (UART) converter or adapter. I would suggest adapters based on CP210x chip. They usually have both 3.3V and 5V and a Reset pin. Connection scheme you can find in google by searching for "arduino pro mini serial adapter connection" or something like that. Note that if you connected everything but still can't upload sketch to your board you might have to switch Rx and Tx pins as different manufacturers mark them differently.
-
RE: wristwatches that invite development
Not exactly a smart watch, but related to them. I've bought some round displays some time ago. This B&W: https://www.aliexpress.com/item/4000048389598.html
and this color ones: https://www.aliexpress.com/item/1904222704.html
Would recommend black and white ones, me and olikraus made them work with u8g2 library. It has pretty low power consumption with backlight off.
The color ones are bigger, have higher resolution and color(!). They have only parallel interface, but that's even good, because this way they doesn't have a bottleneck in form of SPI. They work with MCUFRIEND_kbv library after some edits.
So my first thought when I made those displays work was to make opensource smart watch...and then I read about Pine Time -
RE: Everything nRF52840
There seems to be https://github.com/sandeepmistry/arduino-BLEPeripheral library. I tried it some time ago, it was working pretty straightforward. I mean it's not ideal, obviously, but it works for a start.
-
RE: NRF52 watchdog problem (myBoardNRF5)
@kisse66 no, once watchdog is started it can't be disabled, until hard reset. It is deliberate design choice for some reason.
https://devzone.nordicsemi.com/f/nordic-q-a/3143/how-to-disable-the-wdt-watchdog-timer -
RE: Best PC platform for running Esxi/Docker at home?
@NeverDie said in Best PC platform for running Esxi/Docker at home?:
FreeBSD is a more complete OS, and so I suspect the entire thing is better scrubbed than the way Linux distros are thrown together
Haven't you heard the last controversy about wireguard driver merged into FreeBSD core by Pfsense, which had awful quality and was written by some pretty shady person? And it was only a few day before the new release of FreeBSD, when the author of wireguard wrote a letter about it and stopped the commit from being released with the kernel.
https://arstechnica.com/gadgets/2021/03/in-kernel-wireguard-is-on-its-way-to-freebsd-and-the-pfsense-router/
Can't find the long story I've read about it, but this article can explain the matter good enough.
I would say that broader adoption and even segmentation in some way, help more to make robust opensource OS. -
RE: Wireless remote door lock - HW choices
@idanronen some time ago I've built myself a "smart lock" using mysensors node with a servo. I was also worried about hacking potential so I just encrypted the message sent via mysensors network with AES cypher. I was happy to find out that it's pretty easy and doesn't require anything special. You can find my code here: https://forum.mysensors.org/topic/9204/secure-node-encrypted-communication-aes-128 maybe it will help you somehow with your project.
-
RE: NRF52 watchdog problem (myBoardNRF5)
@kisse66 Mysensors can't alter the way the function is implemented in nrf chip. If you go to a link I've posted above, you will see that it is confirmed behavior that is expected by Nordic. Once you have set up and enabled watchdog on NRF5 chip it can't be disabled, nor changed to other settings, without reset via one o these: power, pin, brownout or watchdog.
I guess the description you are referring to is simply wrong, which is confirmed by your experience. I think we need to ask someone capable to edit this part of the description. Can you specify, where exactly this quote is taken from? -
RE: Raspberry Pi gateway + hass.io + MQTT + MySensors
@Sebex okay, I've googled for you, there are plenty reportings of similar issues. It may be caused by insufficient power supply. On intense CPU usage it may lack current. Try getting better power supply rated at 2.5A, 5V.
-
RE: What did you build today (Pictures) ?
@NeverDie tanks for describing it as "professional":)
The clear button on the last photo was one of prototypes as I've mentioned, frankly process of refining the button part to make it work as it should was the longest part of the development. Now it is made in two stages: at first the transparent acrylic part is cut on laser machine, then it placed into a mold with curing mix of resin and concrete, which makes it's black top layer that blocks the light from below. 3mm acrylic base and 2mm resin top layer.
But I have to say that next batches will be made the other way, which is already in my mind:)@MatiasV thanks! Well, I coluld describe the whole process of making, but it requires a lot of work like making propper mold, the process of trial and error while trying to achieve consistant pour and at last the complex process of making a button that would work without sticking.
Frankly I don't think it's worth time and effort if you plan tho do only one switch for yourself. But I can give you hints about concrete mixture and other stuff, if you're just interested in it's concrete part. -
RE: Wireless remote door lock - HW choices
@idanronen said in Wireless remote door lock - HW choices:
attacker could just record and repeat the traffic on the network without knowing the code
That exactly what I was afraid of. I will quote myself here: "When 4 bits are collected it adds 6 random bits before it and 6 random bits after, so the string is 16 bit long. Then it encrypts it as a single AES block and then encodes in base64, which makes 24 bit long message to be sent to a gateway like this 1;1;1;0;47;uKvGG7z440r/1pln4IJbNQ=="
So basically, you end up with different message every time you send it, though the access code is every time the same. And receiver node decodes the message and looks only at the part that is meant to be the code itself, ignoring random salt around it.@idanronen said in Wireless remote door lock - HW choices:
The chips are 5-10 times the prices of stm32 and the whole process seems complicated and support is limited
You can buy nrf52840 modules from EBYTE for around 3.5$ on ongoing sale, nrf52832 are sold for about 4-5$ even without sale. They require your own pcb, to make it all clean and neat, but result is more compact and power efficient. As for support, you don't need to worry about it, everything that should work works, and with Arduino releasing it's new Nano BLE board based on nrf52840, we can expect support to become even wider.
-
RE: Compile on arm64 Raspi 3
@moses https://github.com/mysensors/MySensors/blob/b9d9cc339659f724aa94d4108fc5289a720d1bcd/configure#L266
This is where you edit it. Just delete-mfpu=neon-fp-armv8 -mfloat-abi=hard
and domake clean ./configure
I'm not sure this will work, but I did compile mysensors for aarch64, just for another board and SoC.
-
RE: HassOS + Serial Gateway OR Docker + RPI Ethernet Gateway
@se-O-matic said in HassOS + Serial Gateway OR Docker + RPI Ethernet Gateway:
Can I use the UART Port "/dev/ttyAMA0" in HassOS?
Yes.
@se-O-matic said in HassOS + Serial Gateway OR Docker + RPI Ethernet Gateway:
Are there any limitations in Option2, when HA running in Docker?
Not that I can think of. Supervisor might be unhappy about "unsupported" setup, but it will work. They invented very strict guidelines for supervisor setup, apparently to lift any "responsibility" in terms of support for what people may come up with in their setups. But everything usually works anyway.
-
RE: How can I measure the amps in the water caused by electric leakage
Well, theoretically speaking, you need to know resistance of the water tank, where leakage is occurring. Then you could measure voltage drop across it an divide it by the resistance of the water tank. Another method would be using a shunt between leaking conductor and the water, and measure voltage across it, respectively.
REALISTICALLY, IF YOU HAVE MAINS VOLTAGE LEAKING INTO WATER, YOU DON'T TRY TO MEASURE IT, YOU TURN OFF POWER AND CALL AN ELECTRICIAN.
If it's not mains voltage, well, you can try things.
-
RE: 💬 MySensors NRF5 Platform
@d00616 great tip, thanks! I didn't know about that option, to bad it's buried on the deepest level of documentation. I guess this will do the thing. I greatly appreciate your help, it's a pleasure when people are willing to share their knowledge with others
-
RE: Wireless remote door lock - HW choices
@idanronen yes, good point, but as @Anticimex mentioned, signing has to solve this issue.
-
RE: Relay device not showing up in HA but does in .json
Please read carefully documentation for HA. https://www.home-assistant.io/integrations/mysensors/
You need to send initial state of your sensors. There is example code for doing it. Basically you check in loop if the node just started and send some values to HA. After that your sensor will appear in HA.
-
RE: Advisory: put IOT devices on a separate LAN/vLAN for better security
@NeverDie don't run pfsense or other firewall in proxmox or other virtualization. I tried it and it's a mess. You can buy cheap $100 Dell or HP compact office desktop and add network card and run firewall on that, if you're on a budget. But in any case firewall as the gateway to your network should always be standalone hardware.
I am not saying that your setup in proxmox won't work, just think for when you'll want to restart your proxmox, or do any maintenance on it. -
RE: 💬 VUSBTiny
@neverdie I guess it might be not to program but to talk to something with SPI from a PC via USB.
-
RE: Everything nRF52840
@heinzv by peripherals I mean UART, SPI, I2C and other modules, that can be switched off in NRF52840. Going to sleep mode doesn't disable them, they will still drain current. And as you mentioned by yourself Mysensors sleep function can't be trusted either for doing this for you. I think the best practice will be writing your own sleep function using Nordic's macroses. This way you can be sure everything that needs to be turned off is turned off.
Try reading this thread: https://devzone.nordicsemi.com/f/nordic-q-a/1657/how-to-minimize-current-consumption-for-ble-application-on-nrf51822. -
RE: Advisory: put IOT devices on a separate LAN/vLAN for better security
@NeverDie that's not just a router it's a an x86 motherboard that you can install pfsense on. I think he meant, he wouldn't install pfsense in vm
It is also fairly priced, I have one of their products before, but didn't check them recently, that's a great choice for self-built firewall. -
RE: Gateway Ack Message
@mfalkvidd funny thing is that I read that thread, but somehow after some time and some reading it all messed up in my mind again. I hope this time I'll remember this for longer.
@Soloam you need to write a code in receive function, which will check if ack message is returned. This will ensure your message is received by the GW. Read the thread mentioned by @mfalkvidd. -
RE: Serious hardware issues with GY-521 modules
@Sergio1234 I can't tell for sure that this is same case as mine, but I had problems with this modules too.
They couldn't initialize and the problem was bad soldering of MPU6050 chip. So I tried to resolder it and it worked, but then it stopped, and I had to redo it again.
I've ended up buying sole chips without pcb, because it seems for some reason they can't properly solder them...
Or maybe it's just bad quality of counterfeit chips that are just working for their price.
I would suggest you to buy original chips from known source, if you're building serious products for critical applications. -
RE: Advisory: put IOT devices on a separate LAN/vLAN for better security
@NeverDie I would like to know where did you find those for 80$ and even with cpu included?! I want one!
Anyway just to throw in this one if you haven't seen it yet, there are pfsense boxes from the netgate themselves https://shop.netgate.com/products/2100-base-pfsense. I know there is ongoing controversy with netgate as an entity, but you may consider this as an option even though I prefer to build things myself. -
RE: Sending custom messages from a Raspberry Pi Gateway to Arduino node
If you compile Mysensors for Raspberry Pi as an ethernet gateway, you will be able to send commands to a socket on an IP of your Raspberry. You can use netcat command, or a python script, as described here: https://forum.mysensors.org/post/88439
This way, you won't need any controller software, if you are not planning anything big. -
RE: Serious hardware issues with GY-521 modules
I've looked for prices for you. Mouser - 3.67€ from 1000 pieces, Digikey - 4.08$ from 1000 pieces, LCSC - 1.43$ for same 1000 pieces. So I guess needless to say that GY-521 can't use original TDK chips for a retail price less than 1$ for a complete module.
If you interested: https://lcsc.com/product-detail/Attitude-Sensors_TDK-InvenSense_MPU-6050_TDK-InvenSense-MPU-6050_C24112.html -
RE: Advisory: put IOT devices on a separate LAN/vLAN for better security
@NeverDie my setups are quiet simpler. On one location I don't use vlans at all, as I don't use third-party iot devices that I need to actively separate from my network. On the other location I use Mikrotik RB260GS as a managed switch plus I have 3 LAN ports on my pfsense server, where one of them is used for dedicated subnet for outdoor cameras and wifi's.
I would like to have hardware that could take advantage of 10gbe network, but for now I just keep things simple and slow -
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
Mentioned hardware bugs are easily omitted by using custom sleep function.
-
RE: Everything nRF52840
Found this repo: https://github.com/xriss/nrfx. It has standalone nrf peripheral drivers extracted from an SDK so they can be used in any project without using actual Nordic SDK.
Now with release of a PineTime (opensource smart watch based on nrf52832) we can expect many wonderful opensource projects with our beloved MCU -
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
@electrik yes. You will need an SWD programmer, J-link, ST-link or black magic probe will do. But the thing, you've linked isn't NRF5 device. So if you are asking about exactly that device, then answer is no. Only Nordic bluetooth devices are supported by mysensors. The one you've linked uses TI chip.
-
RE: Looking for a 12-24v DC to 5vDC converter
@TRS-80 look for modules based on MP1584. 4.5V-28V input, up to 3A.
-
RE: Zigbee gateway with support for multiple vendors?
I use Home Assistant that has built-in integration with Zigbee (ZHA). You only need a USB Zigbee dongle, of which there are plenty. https://www.home-assistant.io/integrations/zha/
-
RE: GUIDE - NRF5 / NRF51 / NRF52 for beginners
@Puneit-Thukral you can start looking from here https://forum.mysensors.org/post/92044
-
RE: HLK-PMxx protection: choosing the right MOV / fuse value
@mfalkvidd it should, but in my case fuse somehow stayed intact, but UPS it was plugged into went into protection mode.
Now I am using Mean Well IRM-03 modules in my designs. They are only slightly more expensive than HLK, but have built-in fuse and overvoltage protection: https://www.meanwell.com/Upload/PDF/IRM-03/IRM-03-SPEC.PDF -
RE: Zigbee gateway with support for multiple vendors?
@NeverDie yes, I use this one. But amazon's price is very high, I bought one from aliexpress for 11$. Essentially it's just a USB Zigbee adapter with an external antenna. It identifies as "Texas Instruments CC1352/CC2652".
UPDATE: Wow, it's really became pricier https://www.aliexpress.com/item/1005003606767695.html -
RE: nRF5 action!
Hello guys. Finally I've got some nrf51288 boards, like used here: https://www.openhardware.io/view/510/Button-cell-Temperature-Humidity-sensor I've hooked it up to ST Link, uploaded test sketch and everything worked fine. Then I tried to put it to sleep and measure power consumption. The best number I'm getting is 550uA... And it seems like something is completely wrong with this. Either my readings, or some bug in new version of Mysensors library or nrf5 arduino core.
To be sure it's not particular chip's bug I've checked both I've got, no differences. I've also checked current on stock BLE firmware from manufacturer it was running when they came. It was around 120uA - 200uA while presenting via bluetooth. So I guess it can't be that my readings are completely wrong. But then how can it be that bluetooth presenting consume less current than sleeping?
For now I couldn't find a solution or any hint for this, so I apologize If I am missing something, but I need help.EDIT: I might just delete this post, but maybe someone will search for the same solution. Long story short 600uA extra is due to the lack of low frequency crystal onboard. It makes HFCLK to not shutdown and draws current during a sleep. I knew, that synth RTC will take more current but I didn't expect it to be that much.
Another question is why sleep that depends on pin change and seems doesn't require RTC consumes 1ma? I'm confused... -
RE: Something's cooking in the MySensors labs...
Great work!
Does it include RS485 transport, or only RF for now? Or I've missed that it already works with RF and RS485 simultaneously? -
RE: Zigbee gateway with support for multiple vendors?
@NeverDie you can look here for reference https://www.zigbee2mqtt.io/supported-devices/
-
RE: nRF5 action!
@neverdie but all those bootloaders rely on bluetooth (thus softdevice) for DFU, that means we need to write our custom bootloader which uses different transport.
-
RE: 💬 Building a Raspberry Pi Gateway
@badisensors try ethernet gateway instead of serial. You won't need to pass anything to docker and it works just fine.
-
RE: What did you build today (Pictures) ?
@TheoL there is nothing special in it In fact it's an old design that was waiting for the code to be written for a long time. And there are some issues with it. It seems that external interrupts for zero-crossing make NRF24 ACK fail most of the time. And if I were to make another one of this, I would add some low cost mcu to do the dimming part alone. I have dimmers with EPS8266 that uses Attiny13A for triac control, but I wouldn't try to make it control 4 channels.
Also the time of Atmega328 has passed, I guess. They are marked "Not recommended for new designs" by the manufacturer and I have struggled to fit everything I wanted (UI mostly) in it's memory. I ended up disabling serial output in mysensors and everywhere else, decreasing message buffer size and scraping bytes everywhere else I could to make it work stable without crashing.
I'm not sure if I will continue to make new designs for mysensors, but I think I will use NRF51822, as they are so cheap now at aliexpress, and you can add PA LNA to help with signal strength (theoretically, I haven't tried it). Another way is to use NRF52840 for all new designs, even they are 4-5 times more expensive than 51822 but later you can write a firmware for it to use Zigbee of Thread/Matter and use the same design with new functionality. -
RE: nRF5 action!
@toyman no, if your code is in python. So the deal is "just" to port mysensors to python.
-
RE: Awesome tip: run LinuxFX instead of Windows!
@NeverDie you can try this https://github.com/cryinkfly/Autodesk-Fusion-360-for-Linux. I've set up bottle container for fusion and it works quite nice.
-
RE: nRF5 action!
@ncollins said in nRF5 action!:
would MySensors library need to be rewritten?
Yes.
mbed is RTOS, sandeepmistry's core runs on bare metal instead. -
RE: No merge into master in the last 5 years, should we use development?
@kiesel I would look into ZigBee and/or matter. It's an industry standard, so won't be abandoned any time soon. Or you can try ESPHome if you don't mind using WiFi as a carrier.