Error2 File or Directory Not Found - 6-0040 Waveshare UPS Power Module

Hello,

I have a Jetson Nano Developer Kit 2G (3USB + 1 USBC) with Jetpack Version: 4.6.1-b110 loaded.

I’ve updated and upgraded all the drivers from the Jetson Nano image (ubuntu 18.04) and I’m trying to run the ups software that comes with the Waveshare UPS Power Module.

When I run the display_server.py I get the following error from the utils.py import.

 * Serving Flask app 'display_server' (lazy loading)
 * Environment: production
   WARNING: This is a development server. Do not use it in a production deployment.
   Use a production WSGI server instead.
 * Debug mode: off
 * Running on all addresses.
   WARNING: This is a development server. Do not use it in a production deployment.
 * Running on http://192.168.7.224:8000/ (Press CTRL+C to quit)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "display_server.py", line 79, in _run_display_stats
    power_watts = '%.1f' % power_usage()
  File "/home/joe/Code/UPS-Power-Module/ups_display/utils.py", line 62, in power_usage
    with open("/sys/devices/50000000.host1x/546c0000.i2c/i2c-6/6-0040/iio:device0/in_power0_input", 'r') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/50000000.host1x/546c0000.i2c/i2c-6/6-0040/iio:device0/in_power0_input'

Running the following:

sudo cat /sys/bus/i2c/drivers/ina3221x/6-0040/iio:device0/in_voltage0_input

results in

cat: '/sys/bus/i2c/drivers/ina3221x/6-0040/iio:device0/in_voltage0_input': No such file or directory

Is there something I need to install to get access to this driver?

What the ups software is? Have you contacted with Waveshare?

I have contacted them but have gotten no response.

Here is the product: UPS Power Module for Jetson Nano, 5V Uninterruptible Power Supply, Multi Battery Protection Circuits

I don’t expect you (or anyone) to review all of the above. Really what I need is to understand why the ina3221x driver is not installing the correct 6-0040/iio:device0/in_voltage0_input directories.

I’m trying to monitor power consumption on the ina3221x chip.

When I google the ina3221x driver, the results point to the jetpack drivers install.

Do you have any suggestions where I can get clues to figure this out?

I searched this forum and found this post but it didn’t really answer my question.

This is what I see when I try to get to the folder that should contain 6-0040.

drwxr-xr-x 5 root root    0 May 15 21:02 ./
drwxr-xr-x 4 root root    0 May 15 21:12 ../
drwxr-xr-x 3 root root    0 May 15 21:01 6-0010/
-rw-r--r-- 1 root root 4096 May 15 21:12 bus_clk_rate
--w------- 1 root root 4096 May 15 21:12 delete_device
lrwxrwxrwx 1 root root    0 May 15 21:12 device -> ../../546c0000.i2c/
drwxr-xr-x 3 root root    0 May 15 21:12 i2c-dev/
-r--r--r-- 1 root root 4096 May 15 21:12 name
--w------- 1 root root 4096 May 15 21:12 new_device
lrwxrwxrwx 1 root root    0 May 15 21:12 of_node -> '../../../../firmware/devicetree/base/host1x/i2c@546c0000'/
drwxr-xr-x 2 root root    0 May 15 21:12 power/
lrwxrwxrwx 1 root root    0 May 15 21:12 subsystem -> ../../../../bus/i2c/
-rw-r--r-- 1 root root 4096 May 15 21:12 uevent

Finally, this is the line of code that is failing to run with the File or Directory Not Found error.

I know nothing about the specific software, but if there is a file in “/sys”, then that is not a “real” file, but is instead a file in RAM created by a running kernel feature. The reason this would be missing would be either (A) the feature is not enabled in the kernel config, in which case you could probably build it as a module, or (B) the kernel version differs from what the software was built for, in which case that feature might not be available.

You probably need to read the install docs and find out what kernel config item is used for that feature.

That’s very helpful. So the missing 6-0400 folder is a not-configured feature of the power management chip. I’ll search for drivers for that chip and see if they are installed.

My guess is that somewhere you will find the name of a kernel config item needed to support the user space software. That’s what you’d need to add (probably as a module).

I finally figured it out. The Jetson Nano 2GB does not have an INA chip.

https://docs.nvidia.com/jetson/archives/l4t-archived/l4t-325/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/power_management_nano.html#wwpID0E0QP0HA

Jetson Nano 2GB does not have an INA3221 power monitor.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.