ESP32 Classic MQTT Publisher & Home Assistant

Started by Graham, February 13, 2020, 05:58:57 PM

Previous topic - Next topic

Graham

Quote from: ForeverHomestead on January 13, 2021, 04:46:21 PM
Oh so I used ClassicMQTT and it worked.  It did not open a page, but opeing a browser and going to 192.168.4.1 worked.

It does not like my wifi info though.  Strange because it works elsewhere.

Is there an issue connecting to a mesh network on this? I cannot choose 2.4 or 5 G, the Unifi router does it for me.  I think I had a problem with another device like this.

Oh, the plot thickens....

So I tried to use the other flasher again and entered the same wifi info on the flasher tool.  It seamed as though it did not work... then the blue LED went solid and a browser window opened with an ip address on it.  Nothing ever loaded and after about a minute the blue LED started flashing again....

Every once and awhilke it flashes faster, but then stops..

Sounds like it has a weak wifi signal, how far is it from your wifi router?

the default user/password is: admin/ClassicMQTT
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ForeverHomestead

Wifi router is not far at all.

I did notice something weird when I tried to flash it again.  There was a warning the crystal freq was detected at 40.01 MHz.  It is quite different than normalized freq of 40MHz.

I am off grid and have been equalizing our battery bank for the last couple days by running a generator.  Sometimes that will make a digital clock in my house lose time.  I wonder if there is an issue with this as well.  I will try this all again later tonight when I have the generator off.

Graham

Quote from: ForeverHomestead on January 14, 2021, 12:52:40 PM
Wifi router is not far at all.

I did notice something weird when I tried to flash it again.  There was a warning the crystal freq was detected at 40.01 MHz.  It is quite different than normalized freq of 40MHz.

I am off grid and have been equalizing our battery bank for the last couple days by running a generator.  Sometimes that will make a digital clock in my house lose time.  I wonder if there is an issue with this as well.  I will try this all again later tonight when I have the generator off.

You could try flashing a simple test program to make sure you can establish a connection

https://circuits4you.com/2019/01/05/connecting-esp32-to-wifi-network/
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ForeverHomestead

#108
Interesting.  I never thought of connecting to my hotspot.  I put in credentials for my phones hotspot and it connected right away. 

I have had this before with another device...  a camera I think.  I am not sure why, but some things will not connect to my AmpliFi mesh network..


Graham

Quote from: ForeverHomestead on January 16, 2021, 07:54:58 AM
Interesting.  I never thought of connecting to my hotspot.  I put in credentials for my phones hotspot and it connected right away. 

I have had this before with another device...  a camera I think.  I am not sure why, but some things will not connect to my AmpliFi mesh network..

hmm... you could use the raspberry Pi implementation of ClassicMQTT, since the pi connects directly your ethernet, you won't have these wifi issues.

the other alternative to remote access is to use OpenVPN as described at IOTStack https://sensorsiot.github.io/IOTstack/Accessing-your-Device-from-the-internet/

I use this approach now since it gives me remote access to both my home automation hub running HomeAssistant and my classic via my regular android app.

Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ForeverHomestead

Quote from: Graham on January 16, 2021, 09:35:28 AM
Quote from: ForeverHomestead on January 16, 2021, 07:54:58 AM
Interesting.  I never thought of connecting to my hotspot.  I put in credentials for my phones hotspot and it connected right away. 

I have had this before with another device...  a camera I think.  I am not sure why, but some things will not connect to my AmpliFi mesh network..

hmm... you could use the raspberry Pi implementation of ClassicMQTT, since the pi connects directly your ethernet, you won't have these wifi issues.

the other alternative to remote access is to use OpenVPN as described at IOTStack https://sensorsiot.github.io/IOTstack/Accessing-your-Device-from-the-internet/

I use this approach now since it gives me remote access to both my home automation hub running HomeAssistant and my classic via my regular android app.

Graham.

I wondered about the PI install as well.  I went with the ESP32 because it looked to be the simpler and less expensive way to go.  Looks like that may not work out.

ClassicCrazy

Quote from: ForeverHomestead on January 17, 2021, 10:47:29 AM
Quote from: Graham on January 16, 2021, 09:35:28 AM
Quote from: ForeverHomestead on January 16, 2021, 07:54:58 AM
Interesting.  I never thought of connecting to my hotspot.  I put in credentials for my phones hotspot and it connected right away. 

I have had this before with another device...  a camera I think.  I am not sure why, but some things will not connect to my AmpliFi mesh network..

hmm... you could use the raspberry Pi implementation of ClassicMQTT, since the pi connects directly your ethernet, you won't have these wifi issues.

the other alternative to remote access is to use OpenVPN as described at IOTStack https://sensorsiot.github.io/IOTstack/Accessing-your-Device-from-the-internet/

I use this approach now since it gives me remote access to both my home automation hub running HomeAssistant and my classic via my regular android app.

Graham.

I wondered about the PI install as well.  I went with the ESP32 because it looked to be the simpler and less expensive way to go.  Looks like that may not work out.

The Pi approach is better. There is a learning curve to all these microprocessor projects. Some of it can take a lot of time to figure out.  But Graham and Matt have documented everything about as well as anything I have seen on projects of this type.  The Pi runs Linux  and is more like a computer and can do different things compared to the Esp32 which just can do one thing when programmed.

Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ForeverHomestead

I ordered a pi 4, I will loop back around to this project when it comes in.

ClassicCrazy

Quote from: ForeverHomestead on January 18, 2021, 06:57:37 AM
I ordered a pi 4, I will loop back around to this project when it comes in.

Did you order the kit that comes with case, power supply , hdmi cable, sd card , etc ?
That is the best way to go.

Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ForeverHomestead

Yes, I ordered the starter kit.  I don't know anything about them, but I am techy so don't think it will be an issue.  I like the idea of using the pi as I can also add my own MQTT server to it.  Don't have to rely on internet access to get my data that way.

Thanks for the help guys. 

ClassicCrazy

Quote from: ForeverHomestead on January 19, 2021, 07:01:38 AM
Yes, I ordered the starter kit.  I don't know anything about them, but I am techy so don't think it will be an issue.  I like the idea of using the pi as I can also add my own MQTT server to it.  Don't have to rely on internet access to get my data that way.

Thanks for the help guys.

After you get the Classic DIY Pi stuff going , check out this - it makes installing other good Pi programs easy. You won't have to install Mosquitto though since the Classic DIY already does that. I recommend installing Portainer since you can connect up to it on web browser and  it helps understand what programs are running under Docker.
Watch Andrew Spies video they reference
https://sensorsiot.github.io/IOTstack/Getting-Started/

Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Graham

Quote from: ClassicCrazy on January 19, 2021, 11:13:37 AM
...

After you get the Classic DIY Pi stuff going , check out this - it makes installing other good Pi programs easy. You won't have to install Mosquitto though since the Classic DIY already does that. I recommend installing Portainer since you can connect up to it on web browser and  it helps understand what programs are running under Docker.
Watch Andrew Spies video they reference
https://sensorsiot.github.io/IOTstack/Getting-Started/

Larry

I have some notes on one of my other ClassicDIY projects I'm tinkering with that use IOTStack to help setup the raspberry pi

https://github.com/ClassicDIY/BatteryTester/wiki/Raspberry-Pi-Setup

you will only need to select  Portainer-ce  Eclipse-Mosquito when you run IOTStack/menu.sh


Graham.
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s

ClassicCrazy

Quote from: Graham on January 19, 2021, 02:35:43 PM
Quote from: ClassicCrazy on January 19, 2021, 11:13:37 AM
...

After you get the Classic DIY Pi stuff going , check out this - it makes installing other good Pi programs easy. You won't have to install Mosquitto though since the Classic DIY already does that. I recommend installing Portainer since you can connect up to it on web browser and  it helps understand what programs are running under Docker.
Watch Andrew Spies video they reference
https://sensorsiot.github.io/IOTstack/Getting-Started/

Larry
I have some notes on one of my other ClassicDIY projects I'm tinkering with that use IOTStack to help setup the raspberry pi

https://github.com/ClassicDIY/BatteryTester/wiki/Raspberry-Pi-Setup

you will only need to select  Portainer-ce  Eclipse-Mosquito when you run IOTStack/menu.sh


Graham.

The other day I was trying to figure out why the Classic pi mqtt worked with the mosquitto originally installed but wouldn't work with the Mosquito that I installed with IOT Stack. I used Portainer and  turned off the one that was in original docker ( under Python container ) and then copied some of the mosquitto files from that version over to the mosquitto installed by IOTstack . It didn't work and I gave up on it - didn't want to put any more time into that right then.  Not sure if it matters - I was just curious .

Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

ClassicCrazy

Graham -
Not sure but you might want to note in your instructions that sudo apt full-upgrade only works on the new version of Pi Buster - it won't work on the older version. In case someone is already using a pi from years back with old Pi OS.

Larry
system 1
Classic 150 , 5s3p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system 2
 5s 135w Kyocero , 3s3p 270w Kyocera  to Classic 150 ,   8s Kyocera 225w to Hawkes Bay Jakiper 48v 15kwh LiFePO4 , Outback VFX 3648 inverter
system 3
KID / Brat portable

Graham

Quote from: ClassicCrazy on January 19, 2021, 03:08:35 PM
Graham -
Not sure but you might want to note in your instructions that sudo apt full-upgrade only works on the new version of Pi Buster - it won't work on the older version. In case someone is already using a pi from years back with old Pi OS.

Larry

ok thanks Larry, added the note...

Graham
Off-Grid Island cottage, Lac Simon QC Canada
370 Ahrs @ 24V (4 8L16 batteries)
4 x 250watt panels on dual axis trackers http://tinyurl.com/hfpkgr5
Classic 150, Whizbang Jr.
Android Monitor: http://tinyurl.com/lomzq3s