TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Need help with mausberry turn off circuit

Fri Oct 26, 2018 1:14 am

Hi, I'm running Retropie on my Raspberry3, and after getting a corrupted SD card from improper shutdowns (pull the cord!), I bought a mausberry turn off circuit. I attempted to follow the setup directions provided by the vendor after mechanically installing the new switch:

1. sudo wget http://files.mauseberrycircuits.com/setup.sh
2. sudo bash setup.sh
3. sudo reboot

Unfortunately, I got the following effort after trying step two:
setup.sh: line 1: syntax error near unexpected token `<'
setup.sh: line 1: `<html><head><meta http-equiv="refresh" content="0;url=http://dnserrorassist.att.net.see(window.location)+"&r="+escape(document.referrer)+"&t=0";</script></body><html>'

please note I just typed the error line above, not copy & pasted.

Does anyone have any idea what is happening? It looks like a link is not being found (dns error)? Any help would be appreciated.

Thank you

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6995
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 6:34 am

The site no longer exists, and rather than returning the correct error your isp/dns provider is trying to return a nice web page. Unfortunately this breaks wget and it saves the error page as your file. If you had got a dns failure correctly signalled then wget would have told you the error.

You'll have to find an alternate source of that file.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:21 am

If I understand your answer, the vendor is selling hardware and the software to run it doesn’t exist? If so, how can I download the file in step one successfully?

User avatar
RaTTuS
Posts: 10365
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:29 am

try the contacts they may have not updated all thier site or something ?
http://mausberrycircuits.com/
https://mausberry-circuits.myshopify.com
see also
viewtopic.php?f=63&t=87491
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:38 am

I have tried to contact them. I got one email asking what OS i was running, and then they went radio silent.
Last edited by TXpiGuy on Fri Oct 26, 2018 11:32 am, edited 1 time in total.

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6995
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:43 am

Er, try getting the right URL
http://files.mausberrycircuits.com/setup.sh - no e between maus and berry. That file exists.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

User avatar
RaTTuS
Posts: 10365
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:49 am

Code: Select all

echo '#!/bin/bash

#this is the GPIO pin connected to the lead on switch labeled OUT
GPIOpin1=23

#this is the GPIO pin connected to the lead on switch labeled IN
GPIOpin2=24

echo "$GPIOpin1" > /sys/class/gpio/export
echo "in" > /sys/class/gpio/gpio$GPIOpin1/direction
echo "$GPIOpin2" > /sys/class/gpio/export
echo "out" > /sys/class/gpio/gpio$GPIOpin2/direction
echo "1" > /sys/class/gpio/gpio$GPIOpin2/value
while [ 1 = 1 ]; do
power=$(cat /sys/class/gpio/gpio$GPIOpin1/value)
if [ $power = 0 ]; then
sleep 1
else
sudo poweroff
fi
done' > /etc/switch.sh
sudo chmod 777 /etc/switch.sh
sudo sed -i '$ i /etc/switch.sh &' /etc/rc.local
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:55 am

6by9 wrote:
Fri Oct 26, 2018 10:43 am
Er, try getting the right URL
http://files.mausberrycircuits.com/setup.sh - no e between maus and berry. That file exists.
Just a typo here. It was a correct url when entering the command into the Pi

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 6995
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:57 am

TXpiGuy wrote:
Fri Oct 26, 2018 10:55 am
6by9 wrote:
Fri Oct 26, 2018 10:43 am
Er, try getting the right URL
http://files.mausberrycircuits.com/setup.sh - no e between maus and berry. That file exists.
Just a typo here. It was a correct url when entering the command into the Pi
Nope, "wget http://files.mausberrycircuits.com/setup.sh" works, as Rattus has shown as he has pasted the resulting file. Check your typing.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 10:59 am

Again, step 1 worked fine. I got the file.
Step 2 is where I get the error.

User avatar
RaTTuS
Posts: 10365
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 11:09 am

what is the contents of your setup.sh file
i.e.
sudo apt update && sudo apt install pastebinit
pastebinit setup.sh
or just paste it here in code tabs
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

DirkS
Posts: 9871
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 11:11 am

TXpiGuy wrote:
Fri Oct 26, 2018 10:59 am
Again, step 1 worked fine. I got the file.
Step 2 is where I get the error.
No, you got an html file your ISP thought fit to send you because you had used an invalid URL
The correct file (which I just now donloaded myself) does not contain html tags

TXpiGuy
Posts: 18
Joined: Wed Jan 10, 2018 1:46 am

Re: Need help with mausberry turn off circuit

Fri Oct 26, 2018 11:32 am

DirkS wrote:
Fri Oct 26, 2018 11:11 am
TXpiGuy wrote:
Fri Oct 26, 2018 10:59 am
Again, step 1 worked fine. I got the file.
Step 2 is where I get the error.
No, you got an html file your ISP thought fit to send you because you had used an invalid URL
The correct file (which I just now donloaded myself) does not contain html tags
I just tried it again, but this time the file auto saved as setup.sh.1. The ".1" addition is new.

So I went on to step 2, but used, "bash setup.sh.1" (note the .1). nothing was generated on screen, but I didn't get an error. So I went to step 3 and rebooted, then tried the switch. seems to work fine.

Return to “HATs and other add-ons”