2018-06-10, 02:34 AM
Updated for OP V1.0
***After downloading the attached files and before putting them on your pi change the file type to .py from .txt (cannot put a .py file on forum)***
1. Create a new a new folder in the /home/pi/.openplotter/tools folder called "voltage_code". To do this first change you directory to the tools folder and then create the file (sudo mkdir /home/pi/.openplotter/tools/voltage_code). Then change the folder owner to pi (sudo chown pi:pi /home/pi/.openplotter/tools/voltage_code)
2. Once the folder has been created, place the files “voltage_code.py” and “SDL_Pi_INA3221.py” in it. (/home/pi/.openplotter/tools/voltage_code)
3. In the terminal while in folder /home/pi/.openplotter/tools/voltage_code type “sudo chmod a+x voltage_code.py” to make the code executable
4. To enable the tool open the OpenPlotter configuration file in /home/pi/.openplotter/openplotter.conf. Go to section [TOOLS] and add: “, ['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'voltage_code', '1']” to py.
Mine looks like this (You can cut and paste this into your config file if you have no other special tools):
[TOOLS]
py = [['Demo Tool', 'Tool example', 'demo_tool', '0'],['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115', '0'],['Analog Firmata', 'put analog values to SignalK', 'oppymata', '0'], ['Moitessier HAT', 'configure Moitessier HAT settings', 'moitessier_hat', '0'], ['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'voltage_code', '1']]
5. Reboot or start the tool in the Openplotter menu. The sensor should start automatically at each boot.
Ill answer any questions I can and please let me know if it works for you.
Thanks & Good luck.
***After downloading the attached files and before putting them on your pi change the file type to .py from .txt (cannot put a .py file on forum)***
1. Create a new a new folder in the /home/pi/.openplotter/tools folder called "voltage_code". To do this first change you directory to the tools folder and then create the file (sudo mkdir /home/pi/.openplotter/tools/voltage_code). Then change the folder owner to pi (sudo chown pi:pi /home/pi/.openplotter/tools/voltage_code)
2. Once the folder has been created, place the files “voltage_code.py” and “SDL_Pi_INA3221.py” in it. (/home/pi/.openplotter/tools/voltage_code)
3. In the terminal while in folder /home/pi/.openplotter/tools/voltage_code type “sudo chmod a+x voltage_code.py” to make the code executable
4. To enable the tool open the OpenPlotter configuration file in /home/pi/.openplotter/openplotter.conf. Go to section [TOOLS] and add: “, ['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'voltage_code', '1']” to py.
Mine looks like this (You can cut and paste this into your config file if you have no other special tools):
[TOOLS]
py = [['Demo Tool', 'Tool example', 'demo_tool', '0'],['Analog ads1115', 'put analog values to SignalK', 'analog_ads1115', '0'],['Analog Firmata', 'put analog values to SignalK', 'oppymata', '0'], ['Moitessier HAT', 'configure Moitessier HAT settings', 'moitessier_hat', '0'], ['INA3221 Sensor', 'Adds INA3221 Sensor to I2C Bus', 'voltage_code', '1']]
5. Reboot or start the tool in the Openplotter menu. The sensor should start automatically at each boot.
Ill answer any questions I can and please let me know if it works for you.
Thanks & Good luck.