PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
6 years 2 months ago - 6 years 2 months ago #4246
by pilovis
Replied by pilovis on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
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!
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: 6 years 2 months ago by pilovis.
Please Log in or Create an account to join the conversation.
6 years 2 months ago - 6 years 2 months ago #4247
by pilovis
Replied by pilovis on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
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).
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: 6 years 2 months ago by pilovis.
Please Log in or Create an account to join the conversation.
- ThibmoRozier
-
- Offline
- Elite Member
-
6 years 2 months ago #4248
by ThibmoRozier
Replied by ThibmoRozier on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
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 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.
6 years 2 months ago - 6 years 2 months ago #4249
by pilovis
Replied by pilovis on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
I think it's just a matter to do this:
1) create the config directory:
2) edit the python script
and change this line:
to:
3) if it's not the first run, copy your current configuration file to "/etc/pyradmon" directory:
Launch the script as root user.
that's all.
Thanks again for your nice script.
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: 6 years 2 months ago by pilovis.
Please Log in or Create an account to join the conversation.
6 years 2 months ago - 6 years 2 months ago #4250
by pilovis
Replied by pilovis on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
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
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: 6 years 2 months ago by pilovis.
Please Log in or Create an account to join the conversation.
6 years 2 months ago - 6 years 2 months ago #4251
by pilovis
Replied by pilovis on topic PyRadmon install and set up on Raspberry Pi (Wheezy Raspbian)
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: 6 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.209 seconds