Browse Category: English/Angielski

Informations possibly useful for everyone – and written in English.
Informacje przydatne możliwie wszystkim – z tego powodu napisane po Angielsku.

USW-Flex offline after adoption

Perhaps it will be useful for someone, I couldn’t find the solution for this.

So with fresh Unifi Flex switch, I’ve tried to adopt it with ssh “set-inform http://ip-of-host:8080/inform”. I’ve put IP address of my Unifi Controller in place of “ip-of-host” of course.

The switch shown as ready for adoption in Network Controller, but when adopted it became offline. It was steady blue light on it, so switch reported “adopted”. It was pingable from controller, I could ssh to it, ports where open and so on. Other AP’s on the same network vlan where also fine and previously configured without an issue.

I’ve tried to factory reset it and adopt again – same result.

But when I’ve looked in to the logs on flex I saw this:

Thu Aug 7 07:47:10 2025 daemon.err mcad: mcad[1204]: ace_reporter.reporter_fail(): Unable to resolve (http://unifi:8080/inform)
Thu Aug 7 07:47:10 2025 daemon.err mcad: mcad[1204]: ace_reporter.reporter_fail(): initial contact failed #2940, url=http://unifi:8080/inform, rc=1
Thu Aug 7 07:47:10 2025 daemon.info mcad: mcad[1204]: ace_reporter.reporter_next_inform_method(): next inform family: 10

So despite informing flex it should use IP to connect to the controller – and it used this information since it reported to it – after adoption process start it again wanted to use DNS name for connection. And it failed – since it was not defined this way on my domain/search domain.

So as a quick fix, I’ve added to the flex /etc/hosts line pointing unifi to the right IP and adoption finished. What’s surprising – later on, after adoption was finished correctly – the flex was using again the IP for connection, not the name… strange :/

How to prepare Android tablet for Home Assistant battery less console

First of all, it’s not full and proper howto – since I haven’t documented all the steps. It’s more like a key points guide for myself, when I’ll have to do it again 🙂 Never the less it should be quite useful for anyone struggling to do the same.

Why remove battery?

Since it will be all the time plugged in to power, battery would be charging and discharging all the time. This will kill the battery and could make it bulge or blow. Yet I still don’t get it, why it’s not designed to use only USB power, when connected and battery fully charged (same with laptops). Anyway, to make it safe, we need to get rid of battery.

What tablet to use?

First I wanted some Linux based (or Windows – and install Linux on it) – but variety of those and prices of new one, was not encouraging. So I was stuck with Android (let the google be cursed for what it did with it).

  • I wanted at least FHD display (for good quality of HA dashboard)
  • It should be IPS for good view angles, and sadly not Amoled, since it will display most of the time the same pattern and this is not good for it
  • It should have decent front camera – for movement detection
  • It should be possible to open
  • And it have to be rootable
  • quite new APU would be nice, to have HW acceleration of video decoders for camera views

So my first tablet was N-One NPad Plus – it’s under 100EUR 2K tablet with aluminum case. It was good because the case was closed with latches, not glued, and there was official firmware available, so rooting would be easier.

Sadly, when I wanted to buy another one (for second floor) it was completely out of stock… so I had to findLincPlus T3 tablet something else. I’ve found even cheaper LincPlus T3 tablet, but I guess it won’t be available long. Contrary to NPad, this had no firmware available and was glued 🙁

To open it, you have to use slick pry tool in quite steep angle under the screen, but push it more inside then under the screen – and go around screen, with suction cup pulling it up. It’s not that hard, and doesn’t require to use heat.

Next you have to unscrew two screws holding clamp on battery and screen port.

Tablet won’t run (it will start, but power off itself quickly) without thermistor (or just 10k resistor) on battery temperature line. But since all connection on the PCB are so tiny, it was extremely hard to solder to it and not rip off traces. So I cut of the battery BMS with connector from battery (under yellow kapton tape) and soldered +/- wire to solder joints on BMS board, leaving thermistor as it was.

I’ve made a hole on back of the case to move out wires for power supply.

Power

I’ve checked and it’s working well with 5V power supply (yes I know battery is 4,2V – but tolerance is higher – yet I don’t recommend it, since I don’t know if this wont have negative impact in the long run). It’s working on 5V/2A charger, but when connected to desktop power supply, tablet was able to crash when even 4V/6A limit was set – plain charger won’t cut off power when stressed, like bench power supply, but to remedy power spikes – I’ve added 1F 5,5V super capacitor inline. And it’s working fine.

Android, battery, charging…

Old ways of determining, if the battery is charged or not, was to just measure it’s voltage and extrapolate charge level. So if you use old tablet, with around Android 6 (don’t know exactly) – everything below doesn’t matter. But newer devices, measure current flow out and to the battery, when it’s charging and this way knows how much power has left. Because of this, even when battery is removed and tablet is powered with power supply, battery level will be dropping until 2% (or close to it) and Android will power off device – despite it doesn’t have to do it.

Of course we can’t simply ask Android not to do this and trust us, we know what we are doing. As usual the only way to change battery levels is to get root privileges, and of course Google knows better we shouldn’t do this (that company really sucks).

Rooting…

The easiest way is to use Magisk, it’s also beneficial because it has starting scripts – which we can use to disable battery daemon at startup. 

But every permanent root requires to modify the kernel image or add files to root device and most common way to do it, is to extract it from original firmware made for updates etc. Sadly Linc tablet doesn’t have those and even despite company replied to my email, they said they won’t provide the image.

So we can use DSU (Dynamic System Update) to boot temporary Android OS with root privileges, to be able to copy boot.img and patch it with Magisk.

Prior to this, you have to switch Developer mode and Android, unlock bootloader, and then use this guide to copy boot.img from the device.

Next step is to install Magisk, patch boot.img and install it with fastboot. If you are brave enough, you can use my boot.img already patched with Magisk (it will work only on LincPlus T3 tablet).

Magisk script

Finally we have to create a boot time script to set the battery level and preferably disable the power daemon.

I’ve used the “dumpsys battery” command to spoof battery being 100% and charging, but it’s not the best way, since in background, charging daemon still count discharge and it will show less and less after reboot. 

So add a file to “/data/adb/service.d/”

:/ $ su
:/ # cat /data/adb/service.d/update_battery_level.sh
sleep 20
echo "1" >/sys/devices/platform/soc/10026000.pwrap/10026000.pwrap:mt6366/mt6358-gauge/FG_daemon_disable
/system/bin/dumpsys battery set level 99
/system/bin/dumpsys battery set status 2
/system/bin/dumpsys battery set ac 1

Find in the /sys the FG_daemon_disable file (it’s different for android version and device) – and turn it on by setting it to 1. This is enough, and will set battery to 50% and won’t discharge it. If you wish to change charge level – dumpsys can be used for this purpose. But because it’s available in later state of booting – what’s why I’ve put “sleep 20” on the beginning.

Don’t forget to add +x right on the file.

 

PhotoTrap V2

ESP32-Cam based photo trap

So, we meet again – with esp32-cam board 😉 . My first encounter was rather disappointing. I’ve tried to used it for streaming, and the image was poor quality (OV2640) and what is more troublesome, the board itself was unstable.

Recently I had a need, for some kind of Photo Trap – to see what animals are finding food (that we left for them) close to my land. It could be moose or some kind of deer. Of course I could buy one, but where is the fun in it – and it would be probably much worst. The one I saw was old type, powered with four AA batteries etc. but it had also cellular modem used to send MMS with picture 🙁 in 21 century.

Continue Reading

Kankun smart plug OpenWRT upgrade

During recent cleanups of all my IoTs devices, I wanted to disable Kankun reporting to company servers (I’ve moved everything to customs firmwares like Tasmota or Espurna with House Assistant to manage it – so I don’t want any third parties) and also it seemed to be a good idea to upgrade OpenWRT on it.

If you haven’t seen this type of smart plugs it’s a little nifty device. Comparing to recent Sonoff type smart plugs – that utilize esp8266 (that I like a lot and use with all type of other projects – but mostly ESP32 now) – this plug has Atheros AR9330 rev 1 chipset with full OpenWRT Linux on it. If you want to do more, than just on/off operations it’s just perfect device.

Continue Reading

Candle cnc 1.2b on Linux

If you would like to test latest (yet already quite old) Candle on Linux machine, you could face the same problems as I did – so few tips how to make it work.

I still think UGS platform is a better choice in many cases – but sometimes Candle may be necessity (I have found problem with UGS and Fusion 360 gcode files)..

Anyway, you may face this kind of compilation errors and configuration problems with latest 1.2b source code: Continue Reading

PIDKiln 0.9 – update

It’s time to make it look better, I don’t dare to say good :). So I’ve printed a case with all holes required, and now I’m soldering everything up.

I thought about creating dedicated PCB for it, but it probably would require double side one, and so far I’ve been only making one side PCB on my CNC mill. Other problem I’ve seen was the WiFi antenna on TTGO board. With single PCB for all components, It would be shielded either by PCB or LCD or wires. This board does not have external antenna connector (some other does). So I’ve decided I’ll put ESP32 board separately and at 90deg angle close to the plastic case. This way signal should be not blocked anyway. Continue Reading

PIDKiln v0.6 development – update

So far so good – most of the stuff is done. Currently I’m tuning PID usage, and what’s left is traversing program in time – but that’s easy.

To tune PID parameters and test it, you can use simple halogen light bulb (or car light bulb) connected with thermocouple. This is a good heat source to around 100C and it’s easy to see when it’s working 🙂

You just have to switch SSR to DC-DC one (for kiln you probably will use DC-AC). For easy testing I’ve prepared “Quick program” in LCD menu – where you can set one program step. Provide desire temperature, time and dwell – and you can run it.