New This Weekend

Over the weekend I have added a new MENU item to the blog – COMMENTS – thanks to MrShark for that idea.  Menu top right. The page shows the last 100 comments which will hopefully be useful.

I’ve also added an experimental e-newsletter (again on request, several people said they’d like a weekly summary) for those who like to be informed of new items – the plan being to send out an email maybe once a week or less with simply a list of new entries and short description.  On the RIGHT side of the blog – you’ll see a new form needing only name and email – if you want this newsletter – simply sign it  – you’ll get a confirmation email. No this info won’t go out to anyone else and the emails have an unsubscribe link at the bottom.  This email will ONLY go to those who subscribe.

Much as I like my own software, it is always nice to look and see what others are doing – accordingly, over the weekend I’ve been playing with this software with my Sonoff products – https://github.com/arendst/Sonoff-MQTT-OTA-Arduino  – and providing feedback to the author AND getting suggestions based on my own experiences, implemented pretty quickly.

If you like programming with Arduino/ESP environment and want software for Sonoff TH10/16, Sonoff DUAL and Sonoff POW, this might be one way to go!  Right now a Sonoff DUAL with this software (MQTT communication of course) is running one of my heaters. Not seeing any issues yet.

Hope you’re all having a nice weekend.

Pete.

Facebooktwitterpinterestlinkedin

20 thoughts on “New This Weekend

  1. This project can also drive the ElectroDragon dual wifi switch. Just change a #define in the user_config.h My house is a mixture of ElectroDragon and Sonoff devices.

  2. This project also runs the ElectroDragon dual relay WiFi switch….same code base, just a build switch

  3. Few suggestions about last 50 comments:
    – when a post ended with … (means it is cut) if click on 3 dots display the whole post, it’s more convenient than open a new page
    – instead of last 50 comments (sometimes doesn’t cover 24 hours) I think is better last 3 days comments, for persons who visit your blog every few days

    1. Interesting comment there though discussing large message sizes – and the example gives a 64 byte buffer. That’s not large really. It’s an issue I’ve had with my SDK (not C++) version also – I think I’ve set the buffer size at 80 characters.. now, you may think that’s a lot – but as we get more ambitious we sent larger and larger messages with more info.

      Maybe the ESP32 will alleviate this issue in time.

  4. I have to say his code looks fine at first glance. I’ve suggested to him that two SSIDs would be good – not sure how easy that would be to do in the Arduino code (I have the source, could do it myself of course)… but other than that – marvellous.

    1. Hi Pete, I have been using a hacked version of Arendst’s code for a while now. His code and your blog is an excellent way to learn to use MQTT and what can be achieved with it. I would highly recommend anyone new to MQTT to study his code especially if they use the Arduino IDE.
      At the moment I am getting into Node-Red and I love it. Currently working my way through your ESPlogin code to process the MQTT messages and save data to SQLite. Having to learn a bit of Node.js too!

      1. Hi Pete I also recently tried arendst,s software for sonoff_pow it works great although I hacked it a little as I don’t use his ota or web update stuff.

    1. If you look at arendst’s wiki he shows a diagram that has the best way to ground gpio0 to flash the code

    2. Ah yes, the Flash DUAL – well, it turns out that the button is no longer on GPIO0… I simply took a lead (a very thin lead) and carefully shorted GPIO0 to ground while applying power. That is – looking at the ESP chip with the round orientation marker top left – GPIO0 is the second last pin on the bottom – over at the right end… don’t do this if your hands shake!!!

  5. Well, I’m having a play with ARENDST’s code – solved all the issues with the compilation – it’s ok – took a bit of getting my head around – but it seems to work fine – and being MQTT it works just fine with my kit. Suggested he has a look at the wall-switch as well as that’s missing from his otherwise pretty full arsenal. Something new to play with!

    1. checked the code linked above and it seems you need serial command for the DUAL or the 4 relays board (as well sold by itead):

      void setRelay(uint8_t power)
      {
      if ((sysCfg.model >= SONOFF_DUAL) && (sysCfg.model <= CHANNEL_4)) {
      Serial.write(0xA0);
      Serial.write(0x04);
      Serial.write(power);
      Serial.write(0xA1);
      Serial.write('\n');
      Serial.flush();
      } else {
      digitalWrite(REL_PIN, power & 0x1);
      }
      }

    1. Well, I thought I’d give his software a try…. (could not find DUAL port) – but even with the latest Arduino environment I got a couple of problems.

      sonoff:1799: error: ‘class HardwareSerial’ has no member named ‘baudRate’
      webserver:830: error: ‘class EspClass’ has no member named ‘getCoreVersion’
      ‘class ESP8266HTTPUpdate’ has no member named ‘rebootOnUpdate’

      I’ve dropped him a line.

Comments are closed.