diy solar

diy solar

Off-grid Solar / Battery monitoring and control freeware

Also, (sorry, I'm new to all this), how do I
Code:
# Optional
# Add Prometheus and node_exporter to systemctl so they start at boot automatically
?
 
Look at the first few lines of the script, it tells you how to fix that problem.
You'll laugh at my stunning ignorance, but I don't understand those directions. I used
Code:
~/SolarShed $ python3 pip3 install minimalmodbus
and got
Code:
python3: can't open file 'pip3': [Errno 2] No such file or directory
. I'm sure there's something obvious I'm missing, I just don't know what it is.
 
Ah, had to install pip3.
Code:
sudo apt install python3-pip
. For those of you reading, I'm sure I'm not the only who is equally psyched on doing this and incompetent. Just keep going. :)
 
Got to the next step! This is a real adventure.
Code:
~/SolarShed $ python3 RenogyWanderer.py
Traceback (most recent call last):
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/usb1'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "RenogyWanderer.py", line 22, in <module>
    renogy = minimalmodbus.Instrument('/dev/usb1', 1)
  File "/home/solar/.local/lib/python3.7/site-packages/minimalmodbus.py", line 215, in __init__
    write_timeout=2.0,
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/usb1: [Errno 2] No such file or directory: '/dev/usb1'
 
/dev/ttyUSB1 was not found. To see what serial port is being used unplug/plug in your serial port and run # dmesg to see what port it used. Then edit the script to use the right one. Its probably USB0
 
Good guess! Whew, that was a ton to read through, but I think this is what shows it:
Code:
 usb 1-1.3: FTDI USB Serial Device converter now attached to ttyUSB0
 
No problem reading the error messages, it's making sense of 'em that's tricky. :)
Code:
~/SolarShed $ python3 RenogyWanderer.py
Traceback (most recent call last):
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
FileNotFoundError: [Errno 2] No such file or directory: '/dev/usb0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "RenogyWanderer.py", line 22, in <module>
    renogy = minimalmodbus.Instrument('/dev/usb0', 1)
  File "/home/solar/.local/lib/python3.7/site-packages/minimalmodbus.py", line 215, in __init__
    write_timeout=2.0,
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 2] could not open port /dev/usb0: [Errno 2] No such file or directory: '/dev/usb0'
 
Do each of those lines that start with "File" indicate an error on that line, or is the only error on that last one, "could not open port..."?
 
Ok, thanks. I updated the RenogyWanderer.py to have /dev/ttyUSB0 and now get a new error, this time for permission.
Code:
~/SolarShed $ python3 RenogyWanderer.py
Traceback (most recent call last):
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 322, in open
    self.fd = os.open(self.portstr, os.O_RDWR | os.O_NOCTTY | os.O_NONBLOCK)
PermissionError: [Errno 13] Permission denied: '/dev/ttyUSB0'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "RenogyWanderer.py", line 22, in <module>
    renogy = minimalmodbus.Instrument('/dev/ttyUSB0', 1)
  File "/home/solar/.local/lib/python3.7/site-packages/minimalmodbus.py", line 215, in __init__
    write_timeout=2.0,
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialutil.py", line 244, in __init__
    self.open()
  File "/home/solar/.local/lib/python3.7/site-packages/serial/serialposix.py", line 325, in open
    raise SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
serial.serialutil.SerialException: [Errno 13] could not open port /dev/ttyUSB0: [Errno 13] Permission denied: '/dev/ttyUSB0'
 
Used sudo and got a better(?) result, though still not there.
Code:
~/SolarShed $ sudo python3 RenogyWanderer.py
Traceback (most recent call last):
  File "RenogyWanderer.py", line 15, in <module>
    import minimalmodbus
ModuleNotFoundError: No module named 'minimalmodbus'
 
I made sure to install minimalmodbus before, but just in case,
Code:
~/SolarShed $ pip3 install minimalmodbus
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: minimalmodbus in /home/solar/.local/lib/python3.7/site-packages (1.0.2)
Requirement already satisfied: pyserial>=3.0 in /home/solar/.local/lib/python3.7/site-packages (from minimalmodbus) (3.5)
I did it again.
 
Had to go through the whole
Code:
 If you encounter errors like - AttributeError: module 'serial' has no attribute 'Serial'
# pip3 uninstall pyserial
# pip3 uninstall serial
# pip3 uninstall minimalmodbus
# pip3 install pyserial
# pip3 install minimalmodbus
again after changing the ttyUSB. But it's spitting out info. Rad!
Code:
Reading Renogy Wanderer data...
Battery SOC: 100.0 %
Battery Voltage: 13.3 v
Charging Amps: 0.46 a
controller temp: 30.0 C
Load watts: 0 w
PV volts: 14.0 v
PV amps: 0.42 a
PV watts: 6 w
bat max volts: 13.2 v
bat min volts: 13.3 v
todays charge power: 74.0 w
todays discharge power: 0.0 w
Charge state: 4 boost
Bat Type: gel
 
Back
Top