Navigation

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

    Topics created by Clone Tv

    • Clone Tv

      MQTT RETAIN messages work a little strangely
      Development • • Clone Tv  

      5
      0
      Votes
      5
      Posts
      40
      Views

      Clone Tv

      I do not use signed messages, so I used the Signed flag in the MySensors packet header to implement selective MQTT retain state. Gateway is ESP2866 - no specific code. Code send from client: template<typename T> void reportMsg(const uint8_t & id, const mysensors_data_t & tag, const T & val, const bool retain) { MyMessage msg(id, tag); msg.setSigned(retain); send(msg.set(val), true); } Lite patch MyGatewayTransportMQTTClient.cpp: bool gatewayTransportSend(MyMessage &message) { ... bool retain = message.getSigned(); message.setSigned(false); ....
    • Clone Tv

      Gateway - I2C Advanced button and led
      My Project • httpsgist.github.comclclon • • Clone Tv  

      2
      1
      Votes
      2
      Posts
      34
      Views

      Clone Tv

      small fix of the patch, removed "contact bounce" in the inclusive button.
    • Clone Tv

      Where to send messages about battery charge and signal strength?
      MyController.org • • Clone Tv  

      12
      0
      Votes
      12
      Posts
      144
      Views

      Clone Tv

      Yes, I found It may be useful for those who might come across this issue later: Git MYCONTROLLER repo Code for sending RSSI from loop function. It is not necessary to announce (present) the RSSI sensor. MY_CRITICAL_SECTION { char *buff = new char[18]{}; (void) snprintf(buff, 17, "rssi:%d", rssi); reportMsg(getId(), V_VAR5, buff); delete [] buff; }
    • Clone Tv

      Updating InclusionMode Button Behavior
      Feature Requests • • Clone Tv  

      1
      0
      Votes
      1
      Posts
      15
      Views

      No one has replied

    • Clone Tv

      test
      My Project • • Clone Tv  

      3
      0
      Votes
      3
      Posts
      44
      Views

      Clone Tv

      Sorry, that was the test the text is irrelevant to the topic. But, since we are talking about 64-bit numbers on Arduino-like platforms, I'm ready to translate the code that solves this situation. Int64String.h #if !defined(INT64STRING_H) # define INT64STRING_H 1 # if (defined(ARDUINO) && (ARDUINO >= 100)) # include "Arduino.h" # else # include "WString.h" # endif String Int64ToString(uint64_t, uint8_t = DEC, bool = false, bool = false); String Int64ToString(int64_t, uint8_t = DEC, bool = false); uint64_t StringToInt64(String); uint64_t StringToInt64(const char*, uint16_t); #endif Int64String.cpp #include "Int64String.h" #define base16char(A) ("0123456789ABCDEF"[A]) String Int64ToString(uint64_t value, uint8_t base, bool prefix, bool sign) { if (base < 2) base = 2; else if (base > 16) base = 16; uint8_t i = 64; char buffer[66] = {0}; if (value == 0) buffer[i--] = '0'; else { uint8_t base_multiplied = 3; uint16_t multiplier = base * base * base; if (base < 16) { multiplier *= base; base_multiplied++; } if (base < 8) { multiplier *= base; base_multiplied++; } while (value > multiplier) { uint64_t q = value / multiplier; uint16_t r = value - q * multiplier; for (uint8_t j = 0; j < base_multiplied; j++) { uint16_t rq = r / base; buffer[i--] = base16char(r - rq * base); r = rq; } value = q; } uint16_t remaining = value; while (remaining > 0) { uint16_t q = remaining / base; buffer[i--] = base16char(remaining - q * base); remaining = q; } } if (base == DEC && sign) buffer[i--] = '-'; else if (prefix) { if (base == HEX) { buffer[i--] = 'x'; buffer[i--] = '0'; } else if (base == OCT) buffer[i--] = '0'; else if (base == BIN) buffer[i--] = 'B'; } return String(&buffer[i + 1]); } String Int64ToString(int64_t value, uint8_t base, bool prefix) { bool sign = base == DEC && value < 0; uint64_t uvalue = sign ? -value : value; return Int64ToString(uvalue, base, prefix, sign); } uint64_t StringToInt64(String str) { return StringToInt64(str.c_str(), str.length()); } uint64_t StringToInt64(const char *s, uint16_t sz = 0U) { uint64_t val = 0ULL; if (s == nullptr) return val; if (sz <= 0) sz = strlen(s); if (sz <= 2) return val; uint16_t i = (((s[0] == '0') && ((s[1] == 'x') || (s[1] == 'X'))) ? 2U : 0U); for (; i < sz; i++) { const char c = s[i]; if (!isxdigit(c)) return -1ULL; val *= 16; val += (c >= '0' && c <= '9') ? c - '0' : c - 'A' + 10; } return val; } I gave the sources as an apology for the created topic
    • Clone Tv

      Press inclusion button to reboot after 10 sec, ESP8266 only
      Development • • Clone Tv  

      1
      0
      Votes
      1
      Posts
      14
      Views

      No one has replied