Python Daemon

There can only be one daemon process running: that is managed by the PID lock file, like most other Linux daemons. To stop it, do kill `cat /var/run/eg_daemon.pid` To see if it is running: ps -elf | grep `cat /var/run/eg_daemon.pid` Using the pidfile submodule, the PID file is managed automatically. When the daemon is stopped,… Continue reading Python Daemon

ESP8266 WiFi module

Link for add board manager http://arduino.esp8266.com/stable/package_esp8266com_index.json Erase the esp esptool.py erase_flash Code to flash AT firmware to ESP8266 (ESP8266_AT_Bin_V1.5.1) esptool.py –baud 115200 –port /dev/tty.wchusbserial1420 write_flash -fm dio -ff 40m -fs detect 0x00000 boot_v1.7.bin 0x01000 user1.1024.new.2.bin 0xfc000 esp_init_data_default.bin 0x7e000 blank.bin 0xfe000 blank.bin

Arduino and Python

If you want to read Arduino serial from Python. Install pySerial: pip intall pyserial the code: import serial … print(‘# Arduino Reader – hackweb’) print(‘entering loop…’) ardu = serial.Serial(‘COM3’, 115200) time.sleep(2) while True: print(ardu.readline())