Skip to content

Instantly share code, notes, and snippets.

View mat100's full-sized avatar

Matej Supik mat100

View GitHub Profile
@mat100
mat100 / Waveshare RS485 to RJ45 Ethernet.txt
Last active March 22, 2024 17:40
Waveshare Industrial serial server RS485 to RJ45 Ethernet
Waveshare Industrial serial server RS485 to RJ45 Ethernet - https://www.waveshare.com/rs485-to-eth-b.htm
!!! ATTENTION !!!
The converter in MQTT mode supports only 25 transmitted values (read registers).
I'm using this converter in MQTT mode to send predefined registers. This converter works well, but it has one major limit that isn't mentioned anywhere. The supplied VirCom software indeed allows for an unlimited number of registers to be defined, however, the converter in MQTT mode only works with a maximum of 25 transmitted values. If more than 25 are defined, then the converter starts to beep and stops reading data. It took me several hours to uncover this problem.
@mat100
mat100 / linuxcnc-headless-rpi4b.txt
Last active June 30, 2024 08:56
linuxcnc-headless-rpi4b.txt
# To enable auto-login, I have the following in the [SeatDefaults] section of /etc/lightdm/lightdm.conf
autologin-user = cnc
autologin-user-timeout = 10
# install vnc server
sudo apt-get install x11vnc
# Setup vnc password
x11vnc -storepasswd
Send keep alive state every 5 minutes:
Rule1 ON Time#Minute|5 DO publish tele/%topic%/LWT Online ENDONy
Rule1 1
Analog value changed send sensor telemetric:
Rule2 ON analog#a0div10 DO publish tele/%topic%/SENSOR {"ANALOG":{"A0":%value%0}} ENDON
Rule2 1
Source: https://github.com/Wikifab/wikifab-main
Create CT with debian debian-11-standard_11.3-1_amd64.tar.zst
# Log into console and update system
apt update
apt dist-upgrade
# Install docker
apt-get remove docker docker-engine docker.io containerd runc
@mat100
mat100 / rpi4b_fix.txt
Last active September 14, 2022 13:33
https://forums.raspberrypi.com/viewtopic.php?t=305820
sudo nano /usr/local/sbin/eee-disabling-eth0.sh
#!/bin/sh
while true
do
/sbin/ethtool --set-eee eth0 eee off > /dev/null 2>&1
sleep 1
done
prusa-slicer-console.exe --sw-renderer --loglevel=5
Source:
https://computers.tutsplus.com/articles/how-to-clone-raspberry-pi-sd-cards-using-the-command-line-in-os-x--mac-59911
https://github.com/lisanet/PiShrink-macOS
BACKUP ON MACOS
1.) Locate SD Card
diskutil list
2.) Cloning SD Card
Source: https://github.com/arendst/Tasmota/wiki/Esptool
1.) Install python from https://www.python.org/
2.) Download latest Esptool source from https://github.com/espressif/esptool/releases
3.) Install Esptool
cd Downloads/esptool-x.y
python setup.py install
source: https://howchoo.com/g/ndy1zte2yjn/how-to-set-up-wifi-on-your-raspberry-pi-without-ethernet
1.) Switch to boot
cd /Volumes/boot
2.) Create file
nano wpa_supplicant.conf
3.) Paste this content
country=CZ # Your 2-digit country code
Schedule a fsck at the next reboot
sync
sudo touch /forcefsck
sudo reboot
or can use shutdown command for this too
sudo shutdown -rF now
https://raspberrypi.stackexchange.com/questions/3289/checking-sdcard-for-errors-unmount-problem