Controllare la filiera

Un sensore collegato a un Arduino UNO collegato a un Raspberry con MySQL collegato a un PC Windows con Power BI

Per verificare se MySQL è attivo, da una connessione remota con SSH:

sudo systemctl status mysql

Risposta: MySQL è attivo

● mariadb.service - MariaDB 11.8.3 database server
Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; preset: enabled)
Active: active (running) since Sun 2026-06-28 17:23:45 CEST; 15h ago

Per controllare lo spazio disponibile sul Raspberry:

df -h

Risposta:

Per controllare se Arduino è connesso:

lsusb

Guidare una Panda Cross

Tra Ottobre e Novembre 2024 ho guidato per 788km, consumando 225 litri di benzina, con una velocità media di 41,2 km/h con un consumo medio di 11,8 km per litro.

Per tre quarti del tempo ho viaggiato a velocità inferiori a 50 km/h:

Il consumo effettivo alle basse velocità è assai maggiore rispetto ai dati strombazzati della casa madre:

La sesta marcia è una opzione di cui si potrebbe tranquillamente fare a meno. L’ho usata in qualche lunga discesa in autostrada, giusto perché sapevo che stavo registrando:

Tutto ciò è stato registrato con un ODB2 collegato ad Android:

L’app Torque permette di registrare e scaricare i dati in formato .csv, per poterli poi elaborare con Excel o Power BI.

Questi sono i campi che io raccolgo:

Device Time
  G(x)
  G(y)
 G(z)
  G(calibrated)
  Fuel Remaining (Calculated from vehicle profile)(%)
Kilometers Per Litre(Instant)(kpl)
Kilometers Per Litre(Long Term Average)(kpl)
Litres Per 100 Kilometer(Long Term Average)(l/100km)
Fuel flow rate/minute(cc/min)
Engine RPM(rpm)
Throttle Position(Manifold)(%)
Barometric pressure (from vehicle)(psi)
Intake Manifold Pressure(psi)
Air Fuel Ratio(Measured)(:1)
Torque(Nm)
Engine kW (At the wheels)(kW)
Intake Air Temperature(°C)
Engine Coolant Temperature(°C)
Speed (OBD)(km/h)

Visual Airport Guide Directions

Hold handle stationary with PDQ airplane indicator facing forward.

  • Turn outer (white) disc so that heading to airport is in line with PDQ airplane indicator on handle
  • Turn inner disc (yellow for left approach, blue for right approach) so that runway heading appears in runway slot (follow runway heading with zero to get heading).

pdq COMPUTER CO
Asbury Park, New Jersey
patent pending

L’intelligenza artificiale non è intelligente, e quindi?

C’è chi ride con fare sprezzante degli errori commessi dalla AI di ChatGPT e dei suoi cugini, dimenticando che

  • siamo nella primissima infanzia di sistemi che evolvono sempre più in fretta;
  • non importa se non sono intelligenti, basta che siano percepiti come intelligenti (come diceva Turing)

Invece di ridere, pensiamo a come saranno tra tre anni, o a cosa diventeranno nel corso della nostra vita, o di quella dei nostri nipoti.

Conversazione con ChatGPT

In Excel, I have a column of IP addresses that sometimes are recognized as text and sometimes as number. In another column I have written a formula that will convert the IP address as text in 4 groups of 3 digits, separated by a fullstop. The formula is quite complex and I wonder if a simpler version is possible. Here it is:

=IF(ISNUMBER(A2);RIGHT(“00″&LEFT(A2;LEN(A2)-9);3)&”.”&MID(A2;LEN(A2)-8;3)&”.”&MID(A2;LEN(A2)-5;3)&”.”&RIGHT(A2;3);RIGHT(“00″&LEFT(A2;FIND(“.”;A2)-1);3)&”.”&RIGHT(“00″&MID(A2;FIND(“.”;A2)+1;FIND(“.”;A2;(FIND(“.”;A2))+1)-FIND(“.”;A2)-1);3)&”.”&RIGHT(“00″&MID($A2;FIND(“.”;A2;(FIND(“.”;A2))+1)+1;FIND(“.”;A2;FIND(“.”;A2;(FIND(“.”;A2))+1)+1)-FIND(“.”;A2;(FIND(“.”;A2))+1)-1);3)&”.”&RIGHT(“00″&MID(A2;FIND(“.”;A2;FIND(“.”;A2;(FIND(“.”;A2))+1)+1)+1;LEN(A2)-FIND(“.”;A2;FIND(“.”;A2;(FIND(“.”;A2))+1)+1));3))

Yes, a simpler version of the formula is possible. Here’s an alternative:

 =TEXT(A2,”000.000.000.000″)

 This formula converts the value in cell A2 to text using the format “000.000.000.000”, which separates the IP address into 4 groups of 3 digits separated by fullstops.

Thanks, but your formula only works when the IP address is recognized as a number, like in 147.161.232.179. It does not work when the number is recognized as text, like 147.161.232.1

You’re correct, my previous formula will only work if the IP address is recognized as a number. Here’s a modified version of the formula that works for both text and number formatted IP addresses:

 =IF(ISNUMBER(A2),TEXT(A2,”000.000.000.000″),SUBSTITUTE(A2,”.”,”.00″,3)&”.00″)

 This formula checks if the value in cell A2 is recognized as a number, and if so, converts it to text using the format “000.000.000.000”. If it’s recognized as text, the formula uses the SUBSTITUTE function to replace the third instance of “.” with “.00”. This ensures that all IP addresses are formatted as 4 groups of 3 digits separated by fullstops, regardless of their original format.

Good, but IP addresses are recognized as text when any of the second, third or fourh group contains one or two digits. Your formula only works if the fourth group contains precisely one digit

You’re correct, my previous formula does not handle IP addresses where any of the second, third, or fourth groups contain one or two digits. Here’s a modified version of the formula that works for all IP addresses:

 =TEXTJOIN(“.”,TRUE,IF(LEN(A2)<=12,LEFT(A2,3),LEFT(A2,FIND(“.”,A2)-1)),MID(A2,FIND(“.”,A2)+1,3),MID(A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1,3),IF(LEN(A2)<=12,RIGHT(A2,3),RIGHT(A2,LEN(A2)-FIND(“.”,A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1))))

This formula uses the LEN function to determine the length of the IP address, and the FIND function to locate the position of the “.” characters. It uses the LEFT and RIGHT functions to extract the first and last groups of the IP address, and the MID function to extract the second and third groups. Finally, it uses the TEXTJOIN function to concatenate the groups with “.” as the separator. This formula can handle IP addresses with one or two digits in any of the second, third, or fourth groups.

Good, so now we can put together this formula with the one in case the IP address is recognized as a number

Yes, here’s a combined formula that handles both text and number formatted IP addresses:

 =IF(ISNUMBER(A2),TEXT(A2,”000.000.000.000″),TEXTJOIN(“.”,TRUE,IF(LEN(A2)<=12,LEFT(A2,3),LEFT(A2,FIND(“.”,A2)-1)),MID(A2,FIND(“.”,A2)+1,3),MID(A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1,3),IF(LEN(A2)<=12,RIGHT(A2,3),RIGHT(A2,LEN(A2)-FIND(“.”,A2,FIND(“.”,A2,FIND(“.”,A2)+1)+1)))))

This formula first checks if the value in cell A2 is recognized as a number, and if so, converts it to text using the format “000.000.000.000”. If it’s recognized as text, it uses the TEXTJOIN function to format the IP address as described in my previous answer. This formula can handle both text and number formatted IP addresses, regardless of the number of digits in each group.

Can you translate the formula for the Italian version of Excel? Keep in mind that you need to separate the arguments with a semicolon

Yes, here’s the equivalent formula for the Italian version of Excel, where the arguments are separated with a semicolon:

=SE(ÈNUMERO(A2);TESTO(A2;”000.000.000.000″);UNISCI.TESTO(“.”,VERO,SE(LUNGHEZZA(A2)<=12;SINISTRA(A2;3);SINISTRA(A2;TROVA(“.”;A2)-1));MEDIO(A2;TROVA(“.”;A2)+1;3);MEDIO(A2;TROVA(“.”;A2;TROVA(“.”;A2)+1)+1;3);SE(LUNGHEZZA(A2)<=12;DESTRA(A2;3);DESTRA(A2;LUNGHEZZA(A2)-TROVA(“.”;A2;TROVA(“.”;A2;TROVA(“.”;A2)+1)+1)))))

This formula uses the same logic as the original formula, but with the equivalent functions for the Italian version of Excel. The functions used include:

SE (IF)

ÈNUMERO (ISNUMBER)

TESTO (TEXT)

UNISCI.TESTO (TEXTJOIN)

LUNGHEZZA (LEN)

TROVA (FIND)

SINISTRA (LEFT)

DESTRA (RIGHT)

MEDIO (MID)