Cheap Internet temperature logger

The forum for discussing all kinds of brewing paraphernalia.
Post Reply
User avatar
alexlark
Under the Table
Posts: 1403
Joined: Thu May 02, 2013 12:29 pm
Location: Rhondda, South Wales

Re: Cheap Internet temperature logger

Post by alexlark » Thu Apr 06, 2017 5:43 pm

I,ll report back any probs with the relays once I've built it.

I've put a powerline plug in my shed and an old router running as an access point. Strong WiFi!

User avatar
Andy
Virtually comatose but still standing
Posts: 8716
Joined: Fri Nov 18, 2005 1:00 pm
Location: Ash, Surrey
Contact:

Re: Cheap Internet temperature logger

Post by Andy » Thu Apr 06, 2017 6:29 pm

JabbA wrote:I've noticed the same with my setup Andy. The WiFi is right at the limit of the signal to the shed and will drop out regularly. I changed the WiFi connect routine which enabled it to re-connect.

This is in the main loop:

Code: Select all

if (WiFi.status() != WL_CONNECTED) {
    wifidrop++; //increments WiFi drop counter
    setup_wifi();
    return;
  }
  if (!client.connected()) {
    long now = millis();
    if (now - lastReconnectAttempt > 5000) {
      lastReconnectAttempt = now;
      // Attempt to reconnect MQTT
      if (reconnect()) {
        lastReconnectAttempt = 0;
      }
    }
  } else {
    client.loop();
Cheers,
Jamie
Perfect, thanks Jamie. I'll add that into the code. I've forked Vito's github repo and have fixed the date format + some other niggles I've noticed.

https://github.com/allthepies/BrewPiLess

Edit: Looking at your code, it's very different to that in BrewPiLess i.e. there's no setup_wifi() function. Are you definitely talking about modifications to Vito's BrewPiLess ?
Dan!

JabbA

Re: Cheap Internet temperature logger

Post by JabbA » Fri Apr 07, 2017 10:30 am

Andy wrote:Looking at your code, it's very different to that in BrewPiLess i.e. there's no setup_wifi() function. Are you definitely talking about modifications to Vito's BrewPiLess ?
Ahh, no sorry. I've not had chance to have a look at the BrewPiLess code as yet, that's a snippet from my controller code I've lashed together from various examples. I assumed he'd base his code on the examples out there for the ESP8266.

Cheers,
Jamie

JabbA

Re: Cheap Internet temperature logger

Post by JabbA » Fri Apr 07, 2017 10:42 am

I'm shooting in the dark a bit here but I've just had a quick look; In WiFiSetup.h try changing _maxReconnect=0 to something other than zero.

Cheers,
Jamie

User avatar
alexlark
Under the Table
Posts: 1403
Joined: Thu May 02, 2013 12:29 pm
Location: Rhondda, South Wales

Re: Cheap Internet temperature logger

Post by alexlark » Fri Apr 07, 2017 1:34 pm

0 could mean unlimited too.

JabbA

Re: Cheap Internet temperature logger

Post by JabbA » Fri Apr 07, 2017 1:38 pm

alexlark wrote:0 could mean unlimited too.
Indeed it could, worth​ a try though! Caveat- I'm by no means a programmer and lash my code together whist standing on the shoulders of giants!

Cheers,
Jamie

User avatar
Andy
Virtually comatose but still standing
Posts: 8716
Joined: Fri Nov 18, 2005 1:00 pm
Location: Ash, Surrey
Contact:

Re: Cheap Internet temperature logger

Post by Andy » Fri Apr 07, 2017 4:39 pm

_maxReconnect = 0 causes the WifiSetup stayConnected method to continue trying to connect i.e. as alex mentioned, unlimited reconnection attempts.

So, having looked at the code, it should attempt to reconnect if Wifi is lost.

Just hooked it up to a 20x4 LCD which is displaying the same details as the pseudo-lcd in top left of the main webpage.


Image
Dan!

User avatar
alexlark
Under the Table
Posts: 1403
Joined: Thu May 02, 2013 12:29 pm
Location: Rhondda, South Wales

Re: Cheap Internet temperature logger

Post by alexlark » Fri Apr 07, 2017 10:13 pm

Looking good Andy! My screen is due back any day now. Did you use a logic shifter with the screen?

User avatar
Andy
Virtually comatose but still standing
Posts: 8716
Joined: Fri Nov 18, 2005 1:00 pm
Location: Ash, Surrey
Contact:

Re: Cheap Internet temperature logger

Post by Andy » Sat Apr 08, 2017 7:47 am

No, it's directly plugged into the NodeMCU so most probably below spec on the input voltage but it works....

If I were boxing it up for proper use then I'd probably supply Vcc with 5v and investigate if I then needed to go through level shifters for the data lines.
Dan!

User avatar
alexlark
Under the Table
Posts: 1403
Joined: Thu May 02, 2013 12:29 pm
Location: Rhondda, South Wales

Re: Cheap Internet temperature logger

Post by alexlark » Sat Apr 08, 2017 9:02 am

I'm thinking on the same lines. I got a level shifter ready. Still can't believe how cheap these components are!

Fil
Telling imaginary friend stories
Posts: 5229
Joined: Sun Oct 16, 2011 1:49 pm
Location: Cowley, Oxford

Re: Cheap Internet temperature logger

Post by Fil » Sat Apr 08, 2017 3:15 pm

careful buying uber cheap logic level shifters off ebay etc some can arrive without any printed indication of direction needing a magnifying glass to inspect the orientation of components..
ist update for months n months..
Fermnting: not a lot..
Conditioning: nowt
Maturing: Challenger smash, and a kit lager
Drinking: dry one minikeg left in the store
Coming Soon Lots planned for the near future nowt for the immediate :(

User avatar
alexlark
Under the Table
Posts: 1403
Joined: Thu May 02, 2013 12:29 pm
Location: Rhondda, South Wales

Re: Cheap Internet temperature logger

Post by alexlark » Sat Apr 08, 2017 4:11 pm

Yea it is pretty small, I can make it out. Think I need a magnifying glass for the lot though! Lol

User avatar
Andy
Virtually comatose but still standing
Posts: 8716
Joined: Fri Nov 18, 2005 1:00 pm
Location: Ash, Surrey
Contact:

Re: Cheap Internet temperature logger

Post by Andy » Sat Apr 08, 2017 4:56 pm

I enabled the LCD backlight timeout capability in BrewPiLess so the LCD switches off (well the backlight does) after 5 mins. Putting a push-button switch between D3 and ground allows me to turn the light back on again. I'm thinking of replacing the switch with a small PIR module so the backlight will come on if it detects movement in the vicinity.
Dan!

User avatar
MonsieurBadgerCheese
Steady Drinker
Posts: 46
Joined: Wed Dec 23, 2015 8:01 pm

Re: Cheap Internet temperature logger

Post by MonsieurBadgerCheese » Sun Apr 09, 2017 12:58 am

Hi,

Been reading this thread with interest. Does anyone have an 'idiots guide'? Biggest question - do any of these wi-fi things receive a signal from within a fermentation-fridge?

MBC :)

Fil
Telling imaginary friend stories
Posts: 5229
Joined: Sun Oct 16, 2011 1:49 pm
Location: Cowley, Oxford

Re: Cheap Internet temperature logger

Post by Fil » Sun Apr 09, 2017 1:19 am

MonsieurBadgerCheese wrote:Hi,

Been reading this thread with interest. Does anyone have an 'idiots guide'? Biggest question - do any of these wi-fi things receive a signal from within a fermentation-fridge?

MBC :)
https://github.com/universam1/iSpindel
ist update for months n months..
Fermnting: not a lot..
Conditioning: nowt
Maturing: Challenger smash, and a kit lager
Drinking: dry one minikeg left in the store
Coming Soon Lots planned for the near future nowt for the immediate :(

Post Reply