-
connect the Pico to a Linux machine (USB) / serial port
-
in one terminal (ttyACM0 depending on Linux distribution)
minicom -o -D /dev/ttyACM0
-
in another terminal
pigsh 0
-
to connect via serial (/dev/ttyS0)
spigsh 0
-
to connect via web/api
pigroshka 192.168.171.2
(Pico 2)pigroshka YOUR-PIGRO-IP
(Pico W)
remember to prepend 'set' in 'pigroshka'
set pwm0 10
-
pigropico2w.uf2 Pico2_W
-
syslog for Pico2
-
new icons in web ui from https://www.svgrepo.com/
-
PiGro for Pico2 - pico2_pigropicow.uf2 (rp2350)
-
Pico2 webserver (USB)
http://192.168.171.2
orhttps://192.168.171.2
-
PiGro Pico2 only fixed POSIX time string
-
(non-range) time in rules:
time8
,time2:12PM
,time22
addrule time5 -> pwm1 60
will create a rule, executed once, at 5 (AM)
save
your rules when done -
remember: time values never contain a ' ' space character!
always: 'timeHH:MMxM-HH:MMxM'
xM is AM/PM
now, all except the first HH value can be omitted
-
WiFi country code in status
-
GUI reworked
-
pigsh bash script added (minicom , usb)
-
network memory leak fixed (http server)
-
virtual keyboard improved
-
sensors: aht15 / hih71
-
editor fixed
-
press 'Rules Selector' (text) to create a new (empty) rule
netip
get WiFi network ip address
usbip
get USB network ip address
tlog LALA
to write 'LALA' to the syslog server (via TCP)
posixtime CEST-1CET,M3.5.0/2:00:00,M10.5.0/3:00:00
set the timestring (Pico2)
time 13:14:15
set time (24h only)
defaults to 'Europe/Berlin'
'tz_list' contains a list of names / posix time strings (pcodes)
`grep Shanghai tz_list` -> `"Asia/Shanghai","CST-8"`
`grep Belgrade tz_list` -> `"Europe/Belgrade","CET-1CEST,M3.5.0,M10.5.0/3"`
`grep New_York tz_list` -> `"America/New_York","EST5EDT,M3.2.0,M11.1.0"`
`grep Kamchatka tz_list` -> `"Asia/Kamchatka","<+12>-12"`
to adjust your time to New York (in pigsh/spigsh)
`posixtime EST5EDT,M3.2.0,M11.1.0`
then -> `save` to reset and save
tz_list was generated with https://github.com/nayarsystems/posix_tz_db
syslog LALA
to write 'LALA' to the syslog server (via UDP)
tlog LALA
to write 'LALA' to the syslog server (via TCP)
set_country XX
set the wifi country code (to 'WORLDWIDE')
(check the end of this document for the country codes)
liru
list rules (in RAM, stat
shows the rules in 'SRAM')
crules
check / test all rules
crule 7
check / test rule number 7
hostname pigro
set hostname to 'pigro'
ssid0
/cred0
set ssid and credentials (wifi)
ssid1
/cred1
same but for second (alternate) network
stat_bu 3
print status for save backup slot #3 (0-31, rotating)
I2C_SDA 0
I2C_SCL 1
I2C_SDA 26
I2C_SCL 27
UART TX 0
UART RX 1
PWM_0 2
PWM_1 3
PWM_2 4
PWM_3 6
to see the variant (rp2350/rp2040) and the pins you can use 'picotool'
picotool info pigropicow.uf2
sudo picotool load ./pigropicow.uf2 -x --bus 1 --address XX
Or: just drag'n'drop pigropicow.uf2 / pico2_pigropicow.uf2 to your drive
PicoW:
- select WiFi network, enter credentials, CONNECT0, wait...
- after a successfull connection a 'SAVE0' button appears
- press it to save and restart PiGro
- PiGro web client should be available at 'http://pigropicow/' in your network
(from pico/pico-sdk/lib/cyw43-driver/src/cyw43_country.h
)
WORLDWIDE ('XX') AUSTRALIA ('AU') AUSTRIA ('AT') BELGIUM ('BE') BRAZIL ('BR') CANADA ('CA') CHILE ('CL') CHINA ('CN') COLOMBIA ('CO') CZECH_REPUBLIC ('CZ') DENMARK ('DK') ESTONIA ('EE') FINLAND ('FI') FRANCE ('FR') GERMANY ('DE') GREECE ('GR') HONG_KONG ('HK') HUNGARY ('HU') ICELAND ('IS') INDIA ('IN') ISRAEL ('IL') ITALY ('IT') JAPAN ('JP') KENYA ('KE') LATVIA ('LV') LIECHTENSTEIN ('LI') LITHUANIA ('LT') LUXEMBOURG ('LU') MALAYSIA ('MY') MALTA ('MT') MEXICO ('MX') NETHERLANDS ('NL') NEW_ZEALAND ('NZ') NIGERIA ('NG') NORWAY ('NO') PERU ('PE') PHILIPPINES ('PH') POLAND ('PL') PORTUGAL ('PT') SINGAPORE ('SG') SLOVAKIA ('SK') SLOVENIA ('SI') SOUTH_AFRICA ('ZA') SOUTH_KOREA ('KR') SPAIN ('ES') SWEDEN ('SE') SWITZERLAND ('CH') TAIWAN ('TW') THAILAND ('TH') TURKEY ('TR') UK ('GB') USA ('US')
-
sudo nano /etc/ntp.conf
for usb network (network/ip fixed)restrict 192.168.171.0 mask 255.255.255.0 restrict 192.168.171.1 broadcast 192.168.171.255
-
for a wireless network at 192.168.2.0/24 (or whatever you have)
restrict 192.168.2.0 mask 255.255.255.0 restrict 192.168.2.1 broadcast 192.168.2.255
-
restart ntp service and check status
-
sudo systemctl restart ntp
-
sudo systemctl status ntp
- create dir '/var/log/remote'and set owner/rights so it's accessible by syslog
- ubuntu:
sudo mkdir /var/log/remote
sudo chown -R syslog:adm /var/log/remote
sudo chmod 755 /var/log/remote
-
install rsyslog
sudo apt install rsyslog
-
edit '/etc/rsyslog.conf'
sudo nano /etc/rsyslog.conf
-
enable tcp/udp logging by removing the prepending hashes '#' at module and input
# provides UDP syslog reception
module(load="imudp")
input(type="imudp" port="514")
# provides TCP syslog reception
module(load="imtcp")
input(type="imtcp" port="514")
- copy this snippet to the end of your '/etc/rsyslog.conf'
$template remote, "/var/log/remote/%HOSTNAME%.log"
if ($fromhost-ip != "127.0.0.1" ) then -?remote\n
& stop
- restart rsyslog
sudo systemctl restart rsyslog
- and do a status check
sudo systemctl status rsyslog
- in a terminal
tail -n50 -F /var/log/remote/pigropicow.log
(or whatever your hostname is)