SPRING SALE up to 20% OFF! (excludes trade customers)   •   FREE Standard Delivery for orders over £35 (ex VAT)
Support Forum

Share your projects and post your questions

Register   or   Sign In
The Forum

Expander Pi installation problem

The Expander Pi is an Analogue, Digital and RTC development Interface for the Raspberry Pi

13/01/2018

Posted by:
spacinover

spacinover Avatar

I am new to the Expander installed on a RPi-3, and tried to make it work using the various knowledge base pages...

For the RTC clock, I saw in various pages that

$ hwclock -r (or: $ sudo hwclock -r with same result)

should return the RTC date and time, however it pop an error:

hwclock: Cannot access the Hardware Clock via any known method.

The demo_rtcsetdate.py does seem to work, I can change the date in the programme and it prints OK.

How can I get the RTC date and time rather than the network date provided by $ date?

13/01/2018

Posted by:
spacinover

spacinover Avatar

More problems with knwoledge base:

for the Expander, code for writing to IO is given as


#!/usr/bin/env python
from ExpanderPi import IO


Well, it crashes trying to do something with ADC!

However if I use "from IOPi import IOPi" it works.

Further down the variable 'io' change to 'bus'... I picked up the solution by reading the IOPi note for another Pi and putting the correct io=IOP1(0x20).

may be a proof reading of the knowledge base would save time to the customers?

13/01/2018

Posted by:
andrew

andrew Avatar

Hello Robert

The RTC error "hwclock: Cannot access the Hardware Clock via any known method" means that the RTC on the Expander Pi is not visible to the hardware clock routines in Linux.

Can you try running the command "sudo i2cdetect -y 1"? It should return a list of the I2C devices on the bus which with the Expander Pi should be 0x20 and 0x68. If the hardware clock is configured correctly the 0x68 should be replaced with 0xUU. We have an Raspberry Pi RTC tutorial which shows how to configure the RTC on the Expander Pi to be used as a hardware clock in Linux. If you want to control the RTC without using hwclock then you can access it directly using our Python library. The demo_rtcsetdate.py script shows how you can set and read the date using python.

I have fixed the errors in our IO tutorials, thank you for pointing them out. If the expander pi library is crashing with an ADC related error then that could mean the SPI bus is not configured correctly as that is required by the ADC and DAC sections of the library. Can you try going through our SPI tutorial to make sure the SPI bus is configured correctly and see if that fixes the error?

When importing the IO class it is easiest to import the whole Expander Pi library and then create an instance of the IO class by referencing it through the ExpanderPi object.

import ExpanderPi
io = ExpanderPi.IO()

I have updated both of the IO tutorials in the Expander Pi section of the knowledge base to use this method of importing the library.

Sign in to post your reply


Note: documents in Portable Document Format (PDF) require Adobe Acrobat Reader 5.0 or higher to view.
Download Adobe Acrobat Reader or other PDF reading software for your computer or mobile device.