LowPowerLab Forum

Hardware support => MightyHat => Topic started by: phill on January 04, 2017, 03:53:13 PM

Title: RPi Freezing with example sketch [solved]
Post by: phill on January 04, 2017, 03:53:13 PM
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?
Title: Re: RPi Freezing with example sketch
Post by: Felix on January 04, 2017, 04:54:44 PM
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.
Title: Re: RPi Freezing with example sketch
Post by: phill on January 05, 2017, 03:13:22 AM
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:
!

So maybe something with the flash or the radio is causing a problem. I'll have another look tonight if I get time!
Title: Re: RPi Freezing with example sketch
Post by: Felix on January 05, 2017, 07:44:45 AM
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?
Title: Re: RPi Freezing with example sketch
Post by: phill on January 05, 2017, 04:53:19 PM
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
Title: Re: RPi Freezing with example sketch [solved]
Post by: Felix on January 05, 2017, 10:03:46 PM
Glad to hear that, enjoy!
Title: Re: RPi Freezing with example sketch [solved]
Post by: phill on January 06, 2017, 03:00:07 PM
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)
Title: Re: RPi Freezing with example sketch [solved]
Post by: Felix on January 06, 2017, 04:08:01 PM
There are actually 2 things that might need to be done:

- disable GPIO serial console
- enable GPIO UART

Which instructions were you referring to?