PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)

More
5 years 2 months ago - 5 years 2 months ago #4246 by pilovis
I think I've found the problem.
I first downloaded the script on the "/root" directory and launched it as a root user, the program created the config.txt file in the "/root" directory, but when I launched the script at startup, it doesnt matter if it was launched as a root user, it created another config.txt file in the main root "/", I was unaware of that and so I did not configured the other "/config.txt" file, obviously that created the problem.
I would suggest you the have a fixed position for the configuration file (ex.: /etc/pyradmon/config.txt).
Thanks for your great script!
Last edit: 5 years 2 months ago by pilovis.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #4247 by pilovis
Also, I noticed that I have the log file in the "/" main root (or in "/root" when I launch it in foreground).
This is not good for Raspberry or for other embedded devices without a real Hard Disk, having a file on the SD card that is overwritten every 30 seconds can quickly wear-out the SD card or corrupt the filesystem in case of power outages.
I changed the log file position to an external mount: /mnt/sda1 (USB flash drive needed).

# Set logger default info
logging.basicConfig(filename = "/mnt/sda1/pyradmon_log.log", filemode = "a",
    format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    datefmt = "%d/%m/%Y %H:%M:%S %p")
logger = logging.getLogger("PyRadmon (Without audio)")
logger.setLevel(logging.DEBUG)
Last edit: 5 years 2 months ago by pilovis.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago #4248 by ThibmoRozier
Or just give me some time to work on a fix. :)
The way I made this stuff is a bit wonky and can be improved, which is what I am working on during my spare time.
The following user(s) said Thank You: pilovis

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #4249 by pilovis
I think it's just a matter to do this:

1) create the config directory:
sudo mkdir /etc/pyradmon/

2) edit the python script
nano PyRadmon.py

and change this line:
self.CONFIGFILE = "config.txt"

to:
self.CONFIGFILE = "/etc/pyradmon/config.txt"

3) if it's not the first run, copy your current configuration file to "/etc/pyradmon" directory:
sudo cp /config.txt /etc/pyradmon/config.txt

Launch the script as root user.

that's all.
Thanks again for your nice script. :) :) :)
Last edit: 5 years 2 months ago by pilovis.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #4250 by pilovis
Just to help other people having my same hardware and wanting to take part to this project.

I'm using this board:

https://www.cooking-hacks.com/documentation/tutorials/geiger-counter-radiation-sensor-board-arduino-raspberry-pi-tutorial

with Raspberry Pi to Arduino Shield Connection Bridge.

The serial port of this device (Raspberry+Arduino bridge+sensor board) is: /dev/ttyAMA0
Last edit: 5 years 2 months ago by pilovis.

Please Log in or Create an account to join the conversation.

More
5 years 2 months ago - 5 years 2 months ago #4251 by pilovis
To completely disable logging (higly suggested for embedded devices like Raspberry), you need to do this modification on the script:

# Set logger default info
logging.basicConfig(filename = "pyradmon_log.log", filemode = "a",
    format = "%(asctime)s - %(name)s - %(levelname)s - %(message)s",
    datefmt = "%d/%m/%Y %H:%M:%S %p")
logger = logging.getLogger("PyRadmon (Without audio)")
#logger.setLevel(logging.DEBUG)
logger.setLevel(logging.NOTSET)
Last edit: 5 years 2 months ago by pilovis.

Please Log in or Create an account to join the conversation.

Moderators: Gamma-Man
Time to create page: 0.224 seconds
Powered by Kunena Forum
Everything's free. Please support us by considering a donation. Log in first!
Solar powered Raspberry Pi 4 server stats: CPU 35% Memory 13% Swap 17% CPU temp=52.5'C Uptime 41 Days