Tiny Core Linux

Tiny Core Base => Raspberry Pi => Topic started by: foxsam on November 06, 2014, 05:48:42 PM

Title: picore with i2c_bcm2708 module not working
Post by: foxsam on November 06, 2014, 05:48:42 PM
I have 2 i2c devices connected on my picore system. It seems like something is wrong because when I try to access the devices after a bootup I get device busy error message from python script trying to access.
Quote
    self._bus.write_byte_data(self._addr, register, data)
IOError: [Errno 16] Device or resource busy
If I
Quote
modeprobe -r i2c_bcm2708
and then
Quote
modprobe i2c_bcm2708
it works. It seems there is some kind of conflict somewhere but I don't know what.
The devices are an LCD char display and a ds3231 RTC module that also does temp.
I am also having a problem that the RTC does not keep the time over a powerdown  which seems like a battery issue but can it be related?
Title: Re: picore with i2c_bcm2708 module not working
Post by: foxsam on November 06, 2014, 11:00:48 PM
It seems like the line in /opt/bootlocal.sh:
Quote
echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
was causing the problem.
Now there is a new problem (should I start a new thread?) that I cannot access the rtc without that command (whatever it is).
Quote
tc@piCorePlayer:~$ hwclock
hwclock: can't open '/dev/misc/rtc': No such file or directory
tc@piCorePlayer:~$ echo ds1307 0x68 | sudo tee /sys/class/i2c-adapter/i2c-1/new_device
ds1307 0x68
tc@piCorePlayer:~$ hwclock
Wed Dec 31 18:59:59 1969  0.000000 seconds
Title: Re: picore with i2c_bcm2708 module not working
Post by: bmarkus on November 07, 2014, 01:58:06 AM
Try to execute commands as root. It can be an access control issue.