Comments (5)
yes, you are using 64bit OS, it is a bit different from 32bit OS, and if you can enable I2C on this OS ? because the daughter board is communicate with raspberry pi via I2C protocol via USB-C port , you need to enbale dwc2 function so that it can communicate with each other, and for 32bit, just adding dtoverlay=dwc2,dr_mode=host
to /boot/config.txt file and reboot raspberry pi is ok. I am not sure about if 64bit OS also support that dtb file as well.
from upsplus.
I am getting this output
teste@rpi4-20210718:~$ python3 bin/upsPlus_iot.py
Traceback (most recent call last):
File "bin/upsPlus_iot.py", line 18, in <module>
ina_supply = INA219(0.00725,address=0x40)
File "/home/teste/.local/lib/python3.7/site-packages/ina219.py", line 116, in __init__
self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
File "/home/teste/.local/lib/python3.7/site-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
busnum = get_default_bus()
File "/home/teste/.local/lib/python3.7/site-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.
teste@rpi4-20210718:~$ i2cdetect -y 1
-bash: i2cdetect: command not found
teste@rpi4-20210718:~$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
from upsplus.
Well a little search and find this !!
teste@rpi4-20210718:~$ sudo i2cdetect -y 0
[sudo] password for teste:
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: 50 51 -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
teste@rpi4-20210718:~$ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: 03 04 05 06 07 08 09 0a 0b 0c 0d 0e 0f
10: 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f
20: 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f
30: -- -- -- -- -- -- -- -- 38 39 3a 3b 3c 3d 3e 3f
40: 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d 4e 4f
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: 60 61 62 63 64 65 66 67 68 69 6a 6b 6c 6d 6e 6f
70: 70 71 72 73 74 75 76 77
teste@rpi4-20210718:~$ sudo i2cdetect -y 2
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
teste@rpi4-20210718:~$ sudo i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
seems the ic2-3 and not 1
I have 3librarys (i2c-dev , i2c-mux , i2c-smbus) to enable in module.conf (kernel). I am trying 'discover' the right option.
Edit:
teste@rpi4-20210718:~$ sudo i2cdetect -l
[sudo] password for teste:
i2c-3 i2c bcm2835 (i2c@7e804000) I2C adapter
i2c-1 i2c Broadcom STB : I2C adapter
i2c-2 i2c bcm2835 (i2c@7e205000) I2C adapter
i2c-0 i2c Broadcom STB : I2C adapter
from upsplus.
I can get information using @frtz13 script (setProtectionVoltage.py) Will get info and set with success.
/UPSPlus_mqtt# python3 setProtectionVoltage.py 3000
------------------------------------------------------------
Modify battery protection voltage in UPS Plus
------------------------------------------------------------
Current value: 3600 mV
Successfully set the protection voltage to: 3000 mV
Using your scripts... no .. :| getting this errors
# python3 Full-featured-demo-code.py
Traceback (most recent call last):
File "Full-featured-demo-code.py", line 20, in <module>
ina_supply = INA219(0.00725, address=0x40)
File "/usr/local/lib/python3.7/dist-packages/ina219.py", line 116, in __init__
self._i2c = I2C.get_i2c_device(address=address, busnum=busnum)
File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 63, in get_i2c_device
busnum = get_default_bus()
File "/usr/local/lib/python3.7/dist-packages/Adafruit_GPIO/I2C.py", line 55, in get_default_bus
raise RuntimeError('Could not determine default I2C bus for platform.')
RuntimeError: Could not determine default I2C bus for platform.
Running ic2 command
root@rpi4-20210718:~# i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Or this when hwclock disabled
teste@rpi4-20210718:~$ /usr/sbin/i2cdetect -y 3
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- 17 -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: 40 -- -- -- -- 45 -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- 68 -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
teste@rpi4-20210718:~$ python3 UPSPlus_mqtt/fanShutDownUps.py
UPS-Plus to MQTT version 20210624 Copyright (C) 2021 https://github.com/frtz13
This program comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under conditions of the GPL (see http://www.gnu.org/licenses for details).
Type ctrl-C to exit
No reply from UPS on i2c bus. Error message: [Errno 121] Remote I/O error
from upsplus.
Solution: frtz13/UPSPlus_mqtt#14 (comment)
Maybe need do update on your code ?!
from upsplus.
Related Issues (20)
- Power Adapter Report Online and Offline via Online Diagnostics HOT 4
- Need information for 64bit.
- Not charging HOT 2
- Blue LEDs stopped indicating actual battery charge HOT 5
- What is the purpose of shutting down countdown function?
- Batteries not detected - brand new - troubleshooting assistance requested HOT 1
- OSError: [Errno 121] Remote I/O error HOT 8
- Kernel Panic
- Make Firmware Public HOT 7
- Can't revert firmware HOT 2
- Is there a way to physically turn off the ups?
- In normal AC charging mode, Raspi is simply switched off and Raspi does not start when AC is back HOT 5
- I2c read errors HOT 1
- Abs mini tower kit HOT 2
- EP-0118 does not respond via i2c HOT 1
- Cant load files for OLED display on ABS Mini Tower Kit HOT 2
- Bookworm Or RPi 5 Support? HOT 1
- NUT driver for UPSPlus HOT 1
- Firmware v14, changelog/release notes, it's not possible to revert to older version after update to v14 HOT 1
- Can EP-0136 be operated with only one battery installed? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from upsplus.