racpi
Posts: 33
Joined: Mon Dec 30, 2013 11:54 am
Location: australia

reset_on / off no longer work

Wed Feb 25, 2015 8:57 am

just updated and upgraded my raspian to the latest version and now gerts reset_on an reset_off scripts no longer function.
in fact the reset jumper needs to be removed before the gertduino 328 will operate. I assume this will make uploading sketches difficult too.
any tips on how to remedy this would be appreciated.
richard

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: reset_on / off no longer work

Thu Feb 26, 2015 10:18 pm

Confirmed. To have it work again, disable the Device Tree. Do this by adding 'device_tree=' to the end of '/boot/config.txt'.

Code: Select all

sudo nano /boot/config.txt
Scroll down to the end, and add:

Code: Select all

device_tree=
ctrl-x, y, enter, and reboot.[/s] Hopefully a temporary solution, but it works for now.

Edit: Probably even better, use raspi-config to disable it.

Code: Select all

sudo raspi-config
-> 8 Advanced Options
-> A5 Device Tree
-> [No]
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

racpi
Posts: 33
Joined: Mon Dec 30, 2013 11:54 am
Location: australia

Re: reset_on / off no longer work

Sat Feb 28, 2015 5:34 am

thanks for that , problem resolved by disabling device tree

User avatar
DougieLawson
Posts: 34166
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: reset_on / off no longer work

Sat Feb 28, 2015 10:40 am

racpi wrote:thanks for that , problem resolved bypassed by disabling device tree
You need to look deeper, there will come a time when you can't run a Raspberry Pi without the device tree.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: reset_on / off no longer work

Sat Feb 28, 2015 2:33 pm

Very true, eventually someone will have to come up with a better answer. This solution will not last forever.
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

User avatar
Gert van Loo
Posts: 2478
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: reset_on / off no longer work

Mon Mar 02, 2015 11:07 am

I would say this is an error in the Rasbian image.
My reset-on/reset-off code does not use an of the peripheral addresses.
It uses the /sys/class/gpio devices which SHOULD be transparency to those changes.
(What that I mean I expect the /sys/class/gpio device to use the device tree.)
This is the code:

#!/usr/bin/sudo bash
# Set GPIO pin 8, low activating Arduino reset
sudo echo "8" >/sys/class/gpio/export
sudo echo "out" >/sys/class/gpio/gpio8/direction
sudo echo "0" >/sys/class/gpio/gpio8/value
sudo echo "8" >/sys/class/gpio/unexport

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: reset_on / off no longer work

Mon Mar 02, 2015 12:52 pm

Gert van Loo wrote:I would say this is an error in the Rasbian image.
When I asked (http://www.raspberrypi.org/forums/viewt ... 44&t=99113), it was suggested that Raspbian is now doing 'the right thing', where it wasn't before the Device Tree.

With the Device Tree, when a pin is unexported it returns back to an input ('the right thing'). The 'reset_off' script relies on the fact that it stays an output and remembers the '1' written to it (the old 'not the right thing').

It's probably in combination with the voltage level conversion that the 10K AVR reset pullup isn't strong enough to keep the reset pin high. Removing the reset jumper makes the pullup kick in. The 3.3V AVR on the Gertboard still works with the Device Tree, but doesn't need the on/off scripts in the first place.

Not unexporting the pin makes a mess of things the next time you run the script, so I haven't experimented with that much further. Also, since my question in the beforementioned topic, there have been more Raspbian updates which magically made my software work again (with the Device Tree, making my original question redundant for my use case).

I hope this helps.
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

Return to “HATs and other add-ons”