RPi Freezing with example sketch [solved]

Started by phill, January 04, 2017, 03:53:13 PM

phill

My RPi freezes every time I plug the MightyHat in. Unplug it and it starts responding! This started happening since I programmed my MightyHat with the example sketch at https://github.com/LowPowerLab/RFM69/blob/master/Examples/MightyHat/MightyHat.ino

I haven't had time to flash another sketch yet. Is this a known problem?

Felix

First and foremost you should have your Pi serial console DISABLED otherwise it will flood the MHat serial with junk from the Pi booting, resulting in a potential freeze. This is important and I will try to document this a little better.
Otherwise not a known problem under normal circumstances.

Can you give more detail about the "Freezing" ?
Hopefully you do not hot plug/unplug?
You should tune the sample sketch to your needs, there are various settings but generally the sketch is ready for prime time either way and should not impact your Pi.

phill

I did:
sudo systemctl stop [email protected]
that stops the console doesn't it?

When it 'freezes' ssh kicks me out with a "broken pipe" and I loose my services such as DNS and DHCP.

I admit to eventually hot un/plugging it as I got fed up of waiting for the Pi to start didn't want to keep pulling the power from the Pi.

This morning, I had a few spare minutes before work so this is what I tried:

  • Programming the MightyHat with a basic 'Hello World', the Pi worked
    Programming the MightyHat with the full example code, the Pi didn't work
    Programming the MightyHat with the example code with serial functionality commented out, the Pi didn't work
    Programming the MightyHat with the example code with serial, SPI and radio functionality removed and the Pi worked

!

So maybe something with the flash or the radio is causing a problem. I'll have another look tonight if I get time!

Felix

Quote from: phill on January 05, 2017, 03:13:22 AM
Programming the MightyHat with the example code with serial, SPI and radio functionality removed and the Pi worked
So maybe something with the flash or the radio is causing a problem. I'll have another look tonight if I get time!
Haven't seen that before but I can say:
- that same sketch runs fine for me/others
- The MHat only has the following connections to the Pi: 5V, GPIO serial, the power GPIO (Gpio7+8), the RST connected to the atmega328 on the MHat to a GPIO

Again, ensure your serial console is disabled on ttyAMA0, I think that's most likely the problem from the descriptions.
The radio has no link to the Pi. I doubt any radio "interference" will cause a problem, never seen that happen.
Hot plug unplug is not a good idea.

And we're assuming you are powering the Pi through the MHat correct?

phill

Well I tried again tonight. Completely removed the LCD code programmed it, and now its working!

The only other thing i did (before the above) was to disable the serial in raspi-config

Felix


phill

So that didn't quite work!!! Disabling the serial console in raspi-config also disables the serial port. Re Enabling it again to to communicate with the MightyHat caused the RPi to freeze again.

Eventually I found these instructions helpful! (Note Im on a RPi 2)

Felix

There are actually 2 things that might need to be done:

- disable GPIO serial console
- enable GPIO UART

Which instructions were you referring to?