Tonight I'm thinkering with #ESP devices. I'm trying to build this contraption: https://glow-energy.io/docs/resources/schematics
It's an interface to read light pulses from the #electricity #meter , calculate the consumption and report to #homeassistant .
Schematics | Home Assistant Glow 🌟

How to connect the Photodiode and Status LED based on wiring diagram

It should work on both #esp8266 and #esp32 . I tried first the 8266 due to the lower price and energy consumption, but it worked only until rebooted. After reboot it hangs printing a lot of errors. Found somewere in the project issues that it's a known bug in #esphome , so I'll just use the #esp32
This is it, assembled. The #rgb led should blink blue in case of network error and red when a pulse is detected from the #electricity meter. I already added it to #homeassistant (with the #esphome integration), so now it's just matter of trying it with the counter. I will probably need to adjust the #photodiode sensitivity to avoid false positives.
I mounted the #homeassistant #glow temporarily with some tape. I want to test it before building a box for it.
I didn't need to mess with the #photodiode trimmer, it did match already very well the electric #counter pulses.
The #esp32 struggled a lot to get wifi signal, we are very far from the access point, with multiple angled stone wall between. It's a miracle it could connect at all! I'll probably mod the #mcu to solder an external, bigger #wifi antenna.
Well, it works! It was definitely simpler than I anticipated!
In #homeassistant I can see the current power consumption and is pretty similar to what I can read on the counter itself. Nice!
I'll see how the night will go and tomorrow we'll see what to do with the box. On the Home Assistant #Glow website there's a printable box, but I don't own a 3D printer, so I'll have to arrange something with a standard electric box...
Aaaaand it went #offline during the nignt 😅
I imagine -92dBm is not a really good figure 🫠
The electric box is at the end of a far corridor, in a part of the house where noone hangs around, so I'd prefer not to place a #WIFI repeater there.
Tonight I'll try to solder an external #antenna to the #esp32 like explained in the #homeassistant forum: https://community.home-assistant.io/t/how-to-add-an-external-antenna-to-an-esp-board/131601
I'll use the #fontenna (it's the #fon #fonera external antenna I savaged when I... ehm nuked the fonera flashing a firmware in the wrong partition 🫣 ). Will see if it improves the situation...
How to add an external antenna to an ESP board

If you’ve purchased an ESP board without a connector for an external antenna and find you are pushing the limits of reception - all is not lost. Also this is slightly easier than moving the 0603 sized resistor required to use the external antenna socket on some boards. These parts can be found for a couple of dollars on ebay or Aliexpress: Then do this: Good to go:

Home Assistant Community
So, let's try to improve the #Esp32 range with an external antenna.
I scraped the #wifi #antenna contacts and cut the trace going to the rest of the internal antenna. Then soldered the cable with the #sma connector savaged from the #fonera . The shielding of the cable goes to GND (used the multimeter to find which one is GND) and the inner to the other antenna contact.
Reassembled the #homeassistant #glow with the modded #esp32 and connected the #directional #wifi #antenna ("la #fontenna ").
Still no box, that will come when I stop experimenting...
Let's see it if made any difference (just hope I didn't make it worse...)
Hey, it made a difference!
The chart shows the #homeassistant #glow #wifi signal strength. The left trace is before, the gap is when I disassembled it to solder the connector and the right trace is now. Also, you can see clearly when I closed the electric box door after reinstalling it: it's made of thin wood, but apparently is enough to drop the signal by like 5dBm 😯

The signal is still weak, but if it stopped dropping the #connection, is enough for me!
@penguin86 gran bel lavoro👏. Peccato che a casa mia il contatore è stato piazzato a quasi 150m di distanza, altrimenti e non ho speranze di riuscire ad agganciarsi al WiFi. Altrimenti avrei provato a replicare.😥
@saxeee @penguin86 Eh, son tanti... L'ESP32 avrebbe una modalità con pochissima larghezza di banda che però trasmette fino ad 1 km con l'antennina di serie, è una roba proprietaria Expressif, quindi avresti bisogno di 2 esp32, uno sul contatore e uno che riceve e "traduce". ll problema è che non è al momento supportato da Home Assistant Glow, dovresti smanettare col codice...
@[email protected] @penguin86 @saxeee Suddenly, officers of telecomunicaciones agency knock your door 😃
@valenteespinosa @penguin86 @saxeee I hope not! That recess with the electric box is enclosed in 30cm width stone walls, that's a very effective attenuator!
The #homeassistant #glow worked reasonably* well during these days, so I built an enclosure for it.
I don't have a 3D printer, so I used an ugly electronics box.

* it logged some huge power spikes, in the order of half megawatt 😅, that are probably caused by some feedback loop between the status led and the sensor. Building an enclosure for it should fix it.
I fixed the #homeassistant #glow to the power meter with #velcro adhesive tape
There wasn't any power source in the #breaker / #counter box, so I had to add an outlet to power the #homeassitant #glow . I took the power from the nearest distribution box so it is a little cleaner. Unfortunately I didn't have new outlet frames, so I had to reuse an old (and very ugly) one.
At the end, here's the final install. Went to #homeassistant and saw that is working and the #wifi signal, after some tries with the directional #antenna in different positions is at a confortable -68dBm, this should be reasonably solid.
I'll keep an eye on it in the next days.
@penguin86 ricorda vagamente malfunctioning eddie di futurama
@ndo
Già 😂 Un po' tutta la roba che costruisco, per la verità 🫣
@penguin86 per me un grandissimo valore aggiunto!