Hi,
I received my Dot3k hat today and, though the backlight and bar graph appear to work fine, the display will not show text. I’ve tried this on an A+, B+ and RPi 2, using kernels 3.18 and 4.1, with and without device tree overlays, with no success.
I used the curl one-liner to install the modules and examples, and when the example scripts are run, everything behaves as expected (apart from text displaying) and there are no error messages given by Python or in syslog. I’ve double-checked in config.txt and confirmed that SPI and i2c are enabled. Some of the soldering on the board seems dull rather than shiny, but everything else appears in good order.
Do you have any suggestions as to how to fix this, or do you think I have a duff one?
Thanks in advance.
It certainly sounds like there’s something wrong with the DotHAT, but let’s try some debugging just to be sure ( it often turns out to be software weirdness! )
Did you use the same SD card in all 3 Pi’s? I’m guessing by the difference in kernels that you did not, but it’s worth a check. Sometimes SPI gets a little wacky ( I’m yet to find out why ) and a fresh Raspbian install magically fixes it ( this is quickly becoming my alternative to “have you tried turning it off and on again” ).
The LCD uses a write-only SPI interface which is a bit fire-and-forget ( unlike I2C which spits out errors if communication doesn’t work ), so it’s often pretty difficult to tell if there’s a flaky connection, or the SPI setup on the Pi has gone subtly wonky.
Thanks for the reply.
I started out with a completely fresh Raspbian install (05-05-2015) on a Samsung class 10 card, used raspi-config to turn on SPI and i2c, ran sudo apt-get update && sudo apt-get upgrade, used rpi-update to get the 4.1 kernel, then used the curl one-liner to instal the dot hat software (choosing ‘y’ when asked if I wanted to enable SPI and i2c). I tried this on the A+, B+ and Pi 2. No joy.
I then wiped the card, repeating the above but staying with the stock 3.18 kernel. No joy.
Finally, I repeated the procedure, staying with the 3.18 kernel, using a Sandisk Ultra class 10 card solely on the Pi 2. Also no joy. All three Pis are known good boards.
Each time the backlight, capacitive buttons and white LED bar worked as expected, but no text was displayed. I ran a minimal python script that ignored the backlight and should just have printed ‘Hello world’ on the screen. No text appeared.
My only thought is that somehow raspi-config’s SPI and i2c setup is interfering with the curl one-liner’s SPI and i2c setup, but I did try turning off Device Tree Overlays and that made no difference.
I think you’ve been about as thorough as it’s possible to be! I’m now making sure I haven’t borked something up in the software.
Thanks! I’ve just now been messing about with the Pi’s i2c and SPI settings, first letting raspi-config enable them, then disabling them the same way and letting the curl one-liner enable them instead. The results are the same as before.
The only thing I can see from the curl one-liner that might be an issue is that it doesn’t automatically install the cap1xxx python egg that some of the example scripts require. I sudo pip installed it separately and no more complaints. I think that’s an unrelated matter, though.
Which protocol is in charge of displaying the text, i2c or SPI?
It’s SPI. I’ve created a fresh Raspbian image and installed DotHAT- it works. But yes the Cap1xxx module was missing. I’ve updated the installer to include it.
So it’s working from scratch for me, but I’ve got another person saying they’re having trouble getting text to display.
It could possibly be something to do with the LCD contrast but that seems unlikely. It might also be something silly to do with the newly broken out reset pin.
I tried a quick test with lcd.set_contrast(50) but I’ve absolutely no idea what I’m doing with that so that could be the reason it made no difference. If there’s anything you want me to test, let me know.
I should have mentioned that between 35-40 is good for me. I think something rather stranger is happening, though, as @sandyjmacdonald is having the same problem with his DotHAT and I can’t figure out why I’m not.
I have a suspicion that either the Reset pin is flapping in the breeze, or I’ve somehow managed to twiddle a bit on my LCD with an earlier revision of the library that I’ve since changed.
I’m thinking the latter is more likely, but why it works for me and not you and him… I don’t know! I did a fresh install and all that jazz, but still get different results.
Debugging :D
Try running this, and then one of the examples again:
import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
gpio.setup(12,gpio.OUT)
gpio.output(12,gpio.HIGH)
I’ll be outside, falling on my sword.
I’ve implemented the above fix into new versions of the library, which I’ve pushed up to pip. Could you try the following and let me know if it works:
sudo pip install -I dot3k
The -I ( for Ignore ) switch tells pip to ignore already installed libraries, so you should see it reinstall dot3k, st7036, sn3218 and spidev.
Fingers crossed, and thank-you for your patience!
Success!
I ran your script as test.py on an RPi2, and it gave me this message:
test.py:5: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
gpio.setup(12,gpio.OUT)
Then I ran backlight.py and there was text! Wonderful stuff.
What was the cause of the problem?
The cause of the problem was me asking Jon nicely to break out the reset pin on Display-o-Tron HAT ( it was always pulled HIGH on Dot3k and not user-controllable ) then totally forgetting that I actually needed to do something with it, rather than leave it flapping in the breeze.
Your LCD, and Sandy’s, were just sitting in a permanent state of reset. Oh woe is me!
As to why, on three separate Pi’s and with 3 different SD cards it always seemed to work for me… I just don’t know. I think I might be electrically charged and tend to pull things high.
Actually, it worked for Jon too, since we had one or two set up in the office last Saturday lookin’ pretty. Perhaps we’ve been positively charged from hanging around all these lasers.
Hmm. I ran the above command with no errors, rebooted, and ran backlight.py again. No text.
Okay, try that exact same command again. I’d deployed the library as 1.9.1 when the latest was 2.0.0. Duurrr!
I decided to start from scratch and made a fresh Raspbian install, enabled i2c and SPI in raspi-config, ran the curl one-liner, saying ‘y’ to it enabling i2c and SPI too, and rebooted.
I then ran backlight.py and text has appeared! The contrast seems a bit low, but that’s easily sorted.
Thanks for your help in sorting this problem. I hate having to send things back unless I absolutely have to and this has been, in a nerdy way, fun, with a good outcome. Hope you’re getting overtime for this :-D.
Hurrah! Hopefully it’s sorted for everyone else, too. I made a bit of a hash of it!
The default contrast is a bit low. I’ll look into changing that at sometime- right now I need to sleep!
Overtime? I’m on holiday! :D
Hi,
I received the new upgraded version of the Dot3k today and appear to be experiencing the same issues where I cannot get any text to display.
It is a clean raspbian install including the installation script on git repository. Both SPI and I2C are enabled. The bargraph and backlight examples appear to work but not the hello_world example.
I have followed and implemented all the advice in this thread to no avail.
Are you aware of any issues with the upgraded version?
Thanks
I think I might have to make another clean install and see if I can replicate this. Did you update your install with apt-get update && apt-get upgrade
at all?
Yes.
Clean install, enabled SPI and I2C, ran the dot3k installation script followed by the update/upgrade.
I ran through the process again without the update/upgrade just in case the update caused the issue but had the same outcome without text.
Have you had a chance to look into this issue? @gadgetoid