I’ve put my Pi3B+ in the cupboard under the stairs.
Scroll Phat HD is remote from the Pi, on about a metre or so of wiring.
Scroll Phat HD runs, for a while, until I turn the cupboard light on or off, when Scroll Phat crashes.
Error on terminal shows:
Traceback (most recent call last):
File "scrolling1.py", line 46, in <module>
File "/usr/lib/python2.7/dist-packages/scrollphathd/is31fl3731.py", line 594, in show
self.i2c.write_i2c_block_data(self.address, _COLOR_OFFSET + offset, chunk)
IOError: [Errno 121] Remote I/O error
(program exited with code: 1)
Press return to continue
Runs OK again when .py file is retried.
Pi is on a a standard domestic ring-main circuit, flu-tube is on standard domestic lighting circuit.
Any ideas on why a flourescent light would cause Scroll Phat HD to stop?
Any what can I do to prevent it happening?
Best guess is noise (an emf pulse) is messing up the i2c signaling between the Pi and Scroll phat. One thing you could try is wrapping the wires going from the Pi to the scroll pHat in tin foil. Then ground one end of the tin foil. Strip back a couple of inches of bar wire and wrap that tightly around one end of the tinfoil. Then connect the other end to a ground pin on the Pi’s GPIO. Just make sure the tin foil doesn’t touch any other pins on the Pi or the scroll pHat.
If that doesn’t work you may have to get an AC Line filter to put between the Pi power supply and the AC mains.
I’m no expert on how that light works, but it sounds like its still generating electrical interference. I do believe there is a high voltage transformer in there, not sure if it still does anything with the starter out though? Not my field of expertise. An io error is an i2c error, but I think you know that. ;)
If the wires going from your Pi to the scroll pHat are close to the AC electrical wires, I’d rout them a different way, if possible. As far as possible away from the electrical wires.
My longest runs to other i2c devices has been about 7 inches. The 180mm long female to female jumper wires. I try to keep stuff like that as short as possible. Its also likely a good idea to keep the two wires for the i2c the same length
If your using twisted pair cable I’d make the two i2c pins one pair and the two power pins another pair. According to the pinout it only uses 4 pins and that would be all I wired up.
I was just mentioning that I haven’t tried what your doing with a Pi. Not yet anyway ;)
When I was still working, doing installs of electronic equipment, we often used shielded cable for data cable runs. You can get twisted pair cable with a foil wrapped shield around the outside of the wire bundle. And there will be a bare wire around the shield you use to ground the shield. You can get it with each pair shielded with a foil wrap too. It’s a bit pricy though. I haven’t done that type of work in many many years. This the type of cable we used. https://www.bing.com/images/search?q=twisted+pair+shielded+cable&qpvt=twisted+pair+shielded+cable&FORM=IGRE
It can, just not with your setup;)
I feel your pian. I have one Pi that I have a push button wired to a GPIO pin to do a safe shutdown. I had to add my own pullup resister and a filter to keep power spikes from being detected as a signal to shut down. It runs on battery, and when I’d plug my power supply in to recharge it, it would shut down as if the button had been pressed. The Pi’s onboard pullup just wasn’t cutting it.
I now have the scroll phat on a separate Pi, reading from the envirophat db on the first pi.
Although it uses two Pis, the advantage is that they can both go anywhere (on the LAN), and there’s no need for any long wires whatsoever.
It’s a prototype at the moment, but it works.
Busy now writing down as much as I can remember from building it, taking image backups etc.
I don’t want to have to start this from scratch ever again.
It’s actually hit the buffers!
I can’t figure out how to keep the data fresh in the Scroll PhatHD.
The database is being updated, it’s just not playing ball at the other, scrolly showy end.
(I’ve raised a new topic for this, and hoping someone can help.)