-
-
Notifications
You must be signed in to change notification settings - Fork 79
Appendix M Tips and Tricks useful for Genmon
This is a collection of miscellaneous tips and tricks that may be useful when using the Generator Monitor.
Using a raspberry pi as an always connected monitoring device can be tough on your SD card as the linux kernel and installed apps are continuously updating the system logs. One way to prolong your SD card is to use the application log2ram. This program will create a RAM based disk for the /var/log/ directory. This RAM disk is periodically flushed to your SD card. This reduces the number of writes to the SD card which extends the life of the Flash memory on the card.
This page describes how to install log2ram.
If you have a good knowledge of networking and a knowledge of using the linux command line, you can setup your Raspberry Pi without using a monitor or keyboard. In a normal install you would initially use a keyboard and mouse to get the system up and running. This article describes how to setup a headless install.
There are several examples of this on the web. This link contains a linux script that will check if the wifi on the pi is connected and reconnect if needed. This script is run from the pi. Typically you would set this up as a cron job that would run periodically (e.g. every 5 minutes). If the script detected the wifi was not connected it would attempt to reconnect. This thread has additional information on this topic. This thread as an alternate approach that some are using.
On the About page of the web interface there is a mechanism to backup your genmon settings and data files. This would come in handy if your Pi died for any reason.
This thread has info on using an optically isolated RS-232 link to resolved some RS-232 issue with the Evolution controller. Also, this wiki article has info on the topic.
The following assumes you are using the default settings (i.e. your config files are stored in the /etc/genmon folder on the pi:
First take the file that you downloaded from the web interface and transfer it to your pi. You can do this in a few different steps but I like to use the scp program. This command will copy the file genmon_backup.tar.gz to the /home/pi folder on a pi at IP address 192.168.1.10
scp genmon_backup.tar.gz pi@192.168.1.10:./
Then log into the pi with ssh. You should log into the /home/pi directory if you log as the pi user. Once you are logged in type:
tar -xzf genmon_backup.tar.gz
This will unpack the archive file into a folder named genmon_backup. The contents of this folder should be copied to the /etc/genmon folder. You will need root privileges (sudo) since you are copying to the /etc/ folder.
sudo cp ./genmon_backup/*.* /etc/genmon
Then restart genmon:
cd genmon
./startgenmon.sh restart
or reboot
sudo reboot
The backup includes the power log, outage log, service journal, and all config files. If you only want the config files you can on copy the *.conf files.
sudo cp ./genmon_backup/*.conf /etc/genmon
This section gives details on how to use external USB Wifi device so you can use an external antenna.
The test platform is a preloaded Raspberry PI 3A+ with Hat from Pintsize.me. The Pi was already configured using the internal wifi and working fine. (This is typically the point where you realize you need an external antenna). A Mideatek RT5370N Wireless-N USB Adapter from Amazon was used as other posts referred to it as already working on this model. The internal wifi by default comes up as WLAN0. Plug in the external and it comes up as WLAN1.
There are multiple articles on the web, but none seems to exactly fit the use case here - too complex.
Here's the simple solution: Disable the built-in WiFi. By doing this, the USB Wifi will come up as WLAN0, and no other WLAN interfaces will be active. You will not have to change any other settings, as they are already set up for WLAN0.
STEPS: You can open a terminal, connect via SSH, or edit the file directly on the SD card from your computer Open the config.txt file with nano:
sudo nano /boot/config.txt
Find the following line:
# Additional overlays and parameters are documented /boot/overlays/README
And add these two lines under it:
dtoverlay=disable-wifi
dtoverlay=disable-bt
(The second line is to disable the Bluetooth module) Save and exit (CTRL+O, CTRL+X) Power off the Pi, insert the USB Wifi and power up the Pi.
Note: If you've reserved an IP address already for your PI, the will not be working as the MAC address has changed. It should get a new address from DHCP. You'll need to make a new IP address reservation for the new MAC.
For Evolution Controllers, some functions, like resetting the maintenance timers can only be done by accessing the the dealer menu. To access Dealer Menu on the Evolution controller, from the top menu selection (SYSTEM, DATE/TIME,BATTERY, SUB-MENUS) enter (for air cooled models) UP UP ESC DOWN UP ESC UP, then go to the dealer menu and press enter. For liquid cooled models a level 2 dealer code can be entered, ESC UP UP DOWN DOWN ESC ESC, then navigate to the dealer menu and press enter. Passcode for Nexus controller is ESC, UP, UP ESC, DOWN, UP, ESC, UP, UP, ENTER.
As with most open source software, it is a good practice to update the system software. To update the system software on your pi type the following form the console:
sudo apt-get update
sudo apt-get upgrade
If you want to also update the system kernel then instead of "upgrade" use "dist-upgrade":
sudo apt-get update
sudo apt-get dist-upgrade
Depending on the modules that are upgraded, you may need to restart your pi. To restart your pi type:
sudo reboot reboot
This website can be used to locate sites that have raspberry pis in stock.
Thanks to @mac1-131 for the following info. A discussion thread on other email server settings can be found here.
- Sign-in to the Google account you want to use on a PC browser
- Select your account picture and click on Manage you Google Account
- Click the Security tab, then scroll down and click on 2-Step Verification
- Turn it on if it is not already on (no way around this, if you really can't use MFA then stop here)
- Scroll down to the bottom and click on App passwords
- Select an app (Other is good) and give it a name (Genmon is good, or gmail SMTP is good, you can use this password for all IoT devices that need to send emails, not just Genmon)
- Click on Generate and copy the password to your clipboard, or write it down (even though it tells you not to write it down, do it anyway, you will need to put it in your Genmon Settings
- Log into Genmon and click on the Settings link
- Scroll down to Outbound Email Settings and turn it on
- Enter the email account you are using, the one you generated the application password in
- Enter the application password you generated in your Google account settings
- Sender address can be no-reply@gmail.com or you can put in your email if you want, if you have trouble getting emails delivered to your inbox directly, try putting your email address as the sender
- Sender name can be whatever you want, Genmon is fine
- SMTP server is smpt.gmail.com
- Leave port at 587
- Click the Test Email Settings button, you should receive a test email
- Click the Save link at the bottom of the page, Genmon will restart and you should get an email in a couple minutes saying that Genmon was started
- In Genmon Settings, just turn it on and imap.gmail.com is fine, and the default folders are fine
- You must create those folders in the Gmail account yourself, and create a filter to move received emails to that folder. Be advised Gmail now calls folders "Labels" so your are actually working with Labels in Gmail
- Go to Gmail for that account, and on the left side click the + next to Labels
- Create a Label called Generator and do not nest it under any other labels. By default, IMAP access for this folder will be on
- Click the + again, and create another label, nest it under Generator, and call it Processed
- Now you need a filter to move any received emails to the Generator folder. Click the Settings wheel at the top right of your Gmail, and click on See all settings
- Click the Filters and Blocked Addresses tab
- Scroll down and click the Create a new filter link
- In the Subject line, enter generator: and click Create filter
- Under When a message is an exact match, check the Apply the label box and click the drop-down arrow and select Generator
- Click the blue Create filter button
- Send a test email from any email address to your Gmail email address you set this up on with generator: status in the subject line and you should get a response. The email does not need any text, just the subject line
- You can now use the rest of the commands as shown in the wiki, or send generator: help for a list of commands