0

I have been using a PiModules UPS PIco add-on board on my Raspberry Pi B+ using Wheezy for over a year now. No problems.

I just created a new boot SD with Jessie and while the PIco unit seems to be working, the Pi is throwing an error when it runs the RC.Local. For Wheezy the RC.Local has this code

# Run UPS Pico FSSD script and load the included emulated RTC
sudo python /usr/pgms/pico/picofssd.py &

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
( sleep 4; hwclock -s ) &

# start Python Pgm in Screen session
su xyz -c "screen -d -m /usr/bin/python /mnt/usbdrive/pgms/xxx.py

Now under Jessie this throws an error on the "echo ds..." line and then the remaining instructions are not executed.

I assume that something has changed with Jessie. Can someone tell me what changes I need to make to fix this error? Thanks...RDK

PS...I have checked the PiModules forum, but it seems to be very inactive now....

0

While the error messages were not real helpful, I finally noticed a missing " at the end of the command which starts the "screen" window/session. Fixed that and all is happy now....RDK

0

As you noticed yourself, the error you see had nothing to do with the ups_pico module.

But for the record (and to answer your question): If you are using Jessie (2017-04-10-raspbian-jessie.img at the time of this writing), then even the

echo ds1307 0x68 > /sys/class/i2c-adapter/i2c-1/new_device
( sleep 4; hwclock -s ) &

modification of /etc/rc.local is not needed anymore.

In fact all that is needed, is a modification of /boot/config.txt:

# Enable i2c
dtparam=i2c_arm=on

# RTC module
dtoverlay=i2c-rtc,ds1307

For kernel versions newer than 4.4.50 but older than 4.14.37, you need a temporary fix to get the i2c communications with the ups-pico working:

# ups_pico temp fix
dtparam=i2c1_baudrate=10000

For kernel versions starting from 4.14.37, instead of the temporary fix, a new parameter is available:

# ups_pico issue fix
dtoverlay=i2c1-bcm2708,combine=no

For more info on the issue, check the following firmware issue thread: smbus read_i2c_block_data Fails on Latest Kernel, at https://github.com/raspberrypi/firmware/issues/828

Please note, that this fix is not necessary for the standard operation of the ups_pico, being the 'file safe shutdown' functionality.

Only if you rely on the ups_pico's RTC functionality, you need this fix. Without it, there will be error messages in the syslog related to RTC as the RTC functionality is provided using i2c, as is all other functionality.

The developer at Pimodules is apparently aware of the problem (since feb 2017) and has released updated firmware for the newer HV3.0 modules, but not yet for the older HV1.0 and HV1.1 modules.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.