Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. cimba007
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by cimba007

    • cimba007

      Cheap dirty way to send a raw-mysensors message?
      Development • • cimba007  

      13
      0
      Votes
      13
      Posts
      4021
      Views

      Mickey

      @cimba007 Can you post the complete code of the chirp including the headers? Did you only include these libraries: #include <SPI.h> #include "nRF24L01.h" #include "RF24.h" ?
    • cimba007

      [SOLVED] latest git-snapshot causes freezes
      Troubleshooting • • cimba007  

      46
      0
      Votes
      46
      Posts
      9517
      Views

      chrille

      @Yveaux Thank you for committing this fix. I had the same issue and it caused me a lot of headache
    • cimba007

      New Homepage design
      General Discussion • • cimba007  

      31
      2
      Votes
      31
      Posts
      6021
      Views

      cimba007

      Well .. overwriting an !important doesn't seem to be this easy .. The best I could come up with: // ==UserScript== // @name New Userscript // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://forum.mysensors.org/* // @grant none // ==/UserScript== function addNewStyle(newStyle) { var styleElement = document.getElementById('styles_js'); if (!styleElement) { styleElement = document.createElement('style'); styleElement.type = 'text/css'; styleElement.id = 'styles_js'; document.getElementsByTagName('head')[0].appendChild(styleElement); } styleElement.appendChild(document.createTextNode(newStyle)); } (function() { 'use strict'; // Your code here... addNewStyle('.container { width: 55% !important;}'); //$(".container").removeAttr("width"); })();
    • cimba007

      Question: sanitycheck and transportSwitchSM
      Development • • cimba007  

      1
      0
      Votes
      1
      Posts
      530
      Views

      No one has replied

    • cimba007

      Check if the value changed since last time
      Development • • cimba007  

      6
      0
      Votes
      6
      Posts
      1346
      Views

      TheoL

      I think that @Yveaux refers to my generic threshold library (github). It really makes it easy to add sensors and reporting their values to the gateway.
    • cimba007

      mqtt_esp8266_gateway and 1mhz node
      Troubleshooting • • cimba007  

      21
      0
      Votes
      21
      Posts
      4711
      Views

      cimba007

      Using Serial.begin(115200) I experienced some lockups of the atmega328p .. serial communication stopped completely as well as all other operation .. WTF ?!
    • cimba007

      request variable from gateway
      Development • • cimba007  

      13
      0
      Votes
      13
      Posts
      7516
      Views

      cimba007

      @jkandasa said: It is necessary in some cases, Smart-sleep recently added, before when node wake-up get some date(adjust sleep duration) from controller with request Yep .. but this would be even more useful if one node could query other nodes data and receive the resonse from the controller (if the other node is sleeping). Again .. my proposal is to differentiate between: Request data from controller (for any other node, including gateway) ( = history query of most recent update the controller knows about) Request data from destination node ( = live query ) Edit: I just discovered resource groups on mycontroller .. think this will help out a lot with my planned workaround Edit2: I could not help myself and request an improvement: https://github.com/mysensors/MySensors/issues/574
    • cimba007

      Reduce overhead with multiple sensors?
      Feature Requests • • cimba007  

      9
      0
      Votes
      9
      Posts
      2365
      Views

      cimba007

      @m26872 I am currently implementing a little wrapper around the MyMessage object to check for things like "Is it time to send again?!". I use 8000ms Sleep Cycle and then run a bunch of these functions: bool MySensorChild::timeok() { if(mymillis() - _lastsend > _interval || mymillis() < 60000) return true; else return false; } _lastsend is the time the sensor last updated its value. In addition to that I am planning to save the last value too to send only if necessary or after an defined "Minimum send" interval. Using sleep I had to use a little wrapper for millis() unsigned long static millis_offset = 0; unsigned long static mymillis() { return millis()+millis_offset; } and adding the offset myself: sleep(8000); // If powersaving is desired (8s, 4s, 2s, 1s, 500ms, 250ms, 125ms, 64ms, 32ms, 16ms millis_offset += 8000; In addition to that I implemented software ack, retrycount .. and display of RPD Signal Strength indicator. PS: Saving the "lastvalue" seems to be tough. At least if it should be done in a generic ways as the valuetype could be different each time .. int, float etc...
    • cimba007

      NRF24-Autoack
      Troubleshooting • • cimba007  

      6
      0
      Votes
      6
      Posts
      2451
      Views

      cimba007

      I stripped down my example and tried to capsulate it in its own wrapper class. This is by no means complete or ready to use .. it is just there to give interested people some kind of input on how to work with the wait/autoack stuff if you can't use your radios autoretry feature like me. If you need some comments to understand parts of the code feel free to ask. LightSensorSoftwareAckNRF24_class.ino #define MY_NODE_ID 10 #define MY_BAUD_RATE 57600 // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <SPI.h> #include <MySensors.h> #define LIGHT_SENSOR_ANALOG_PIN A3 #define MINUTES 60000UL #define CHILD_ID_LIGHT 0 #include "helper.cpp" void before() { // LightSensor // http://akizukidenshi.com/download/ds/senba/GL55%20Series%20Photoresistor.pdf // GL5549 pinMode(A3,INPUT_PULLUP); // 20-50 kOhm pinMode(A2,OUTPUT); digitalWrite(A2,LOW); } MySensorChild photoSensor = MySensorChild(CHILD_ID_LIGHT,S_LIGHT_LEVEL,"Photoresistor GL5549"); void setup() { } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("LightClass_Test", "0.1"); photoSensor.do_present(); } void loop() { // Set Message photoSensor.message()->set(random(0,100)); // Print Result photoSensor.print(photoSensor.waitsend(250)); delay(1000); } helper.cpp #include "core/MySensorsCore.h" #include "core/MyTransport.h" #include "drivers/RF24/RF24.h" #include <stdarg.h> class MySensorChild { public: typedef struct { uint8_t rpd; unsigned long long elapsedtime; uint8_t success; uint8_t retrycount; } return_struct; void print(return_struct r) { Serial.print(r.success == 1 ? "success" : "fail "); Serial.print(" | "); Serial.print("time: "); p(F("%8d"),r.elapsedtime); Serial.print("uS | "); Serial.print("retr.: "); p(F("%2d"),r.retrycount); Serial.print(" | "); Serial.print("rpd: "); Serial.print(r.rpd); Serial.print(" | "); Serial.println(); } public: MySensorChild(uint8_t childid, uint8_t valuetype, char * description) { // Base Values that define a Message this->description = description; this->childid = childid; this->valuetype = valuetype; this->message_internal = MyMessage(childid, valuetype); } MyMessage * MySensorChild::message() { return &this->message_internal; } void do_present() { present(this->childid, this->valuetype, this->description); } return_struct MySensorChild::waitsend(unsigned long ms) { bool ok = false; const uint8_t retrycountlimit = 10; unsigned long long starttime = micros(); return_struct r; send(message_internal,true); uint8_t c = retrycountlimit; while(!ok && c) { // Ack?! if(wait(ms,message_internal.getCommand(),message_internal.type)) { r.rpd = RF24_readByteRegister(RPD); r.elapsedtime = micros()-starttime; r.success = true; r.retrycount = retrycountlimit-c; return r; //Serial.print(" | rpd: "); Serial.print(RF24_readByteRegister(RPD)); // Return! //return true; } else { if(!isTransportOK()) { Serial.print(" | Transport broken! "); wait(100); } //Serial.print("~"); send(message_internal,true); } c--; } if(c == 0) { r.elapsedtime = micros()-starttime; r.success = false; r.retrycount = retrycountlimit-c; return r; //return false; } } private: // Base Values that define a Message MyMessage message_internal; char * description; uint8_t childid; uint8_t valuetype; unsigned long lastSend; void p(const __FlashStringHelper *fmt, ... ){ char buf[128]; // resulting string limited to 128 chars va_list args; va_start (args, fmt); #ifdef __AVR__ vsnprintf_P(buf, sizeof(buf), (const char *)fmt, args); // progmem for AVR #else vsnprintf(buf, sizeof(buf), (const char *)fmt, args); // for the rest of the world #endif va_end(args); Serial.print(buf); }; }; Example output (mydebug enabled @ gateway) success | time: 16mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 17mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 13mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 11mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 13mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 11mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> fail | time: 2504mS | retr.: 10 | rpd: 0 | <\r><\n> fail | time: 2505mS | retr.: 10 | rpd: 0 | <\r><\n> Always a good idea to disable debugging if you are happy with the performance. Debugging output on serial on the mqtt-gateway (esp8266) takes quite a while. success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 2mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 2mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 5mS | retr.: 0 | rpd: 1 | <\r><\n>
    • cimba007

      [SOLVED] GatewayESP8266MQTTClient - Recovery failure after gateway outage
      Troubleshooting • • cimba007  

      4
      0
      Votes
      4
      Posts
      1789
      Views

      sola

      I have the exact same problem: the node never reconnects to gateway after a gateway outage. In my case it is an ethernet MQTTClientGateway and a humidity node. I have experimented with your suggestion and found that 1000ms was still not enough for a full reconnect before the node goes to sleep, so I made it 3000ms. This seems to allow a reconnect all the time (at least in my environment). // @TODO remove after testing gateway outage if (!isTransportOK()) { #ifdef MY_DEBUG Serial.print("Transport ERROR. Waiting for a proper transport reconnect"); #endif wait(3000); } // Sleep for a while to save energy sleep(UPDATE_INTERVAL); I am unsure why MySensors doesn't have this self-healing element built-in. Maybe it is only a bug, maybe it has some deeper reason.