Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix to gateway not responding #4

Open
ymienert opened this issue Oct 29, 2021 · 20 comments
Open

Fix to gateway not responding #4

ymienert opened this issue Oct 29, 2021 · 20 comments

Comments

@ymienert
Copy link

At first - that's a fast - but running hack!

Due to the V2 issue already discussed
(#2)
I had a deeper look at the OS behind the IPdio mini. So i
wrote a script to let the "reciva gateway not responding" message
disappear and to get the station who is stored at position one
at the presets store, playing. (Power on / Resume)

This script is only tested on two IPdio mini yet. But I have no idea
why it should not be working on another reciva radio device as well.
Prerequisites are that a Sharpin V2 is installed and a reciva device
including remote controll.(this script is calling internal the remote
controll keys at the Sharpin web server)

Remove the file /etc/rc2.d/S17letsplayp1 to deactivate this script.

PLEASE NOTE:
Disadvantages are that the alarm clock is running a bit unreliably
(in this case you can only hear a beeping). Also that the backlight
is flashing for some seconds a minute.

USE AT YOUR OWN RISK!!

LetsPlayP1.zip

@Trashwarez
Copy link

Trashwarez commented Oct 29, 2021

I just installed your script on my IPdio mini and I can confirm that /etc/rc2.d/S17letsplayp1 and /mnt/debug/start_listening_pos1.sh are now both living on my device.
But:
My device still looks for the gateway and complains about Reciva not responding.
Although:
After few seconds my preset 1 starts to play.

Any hints about letting the message disappear?

@ChrizZz90
Copy link

Guys, can you tell me a bit more how to install it? Do I use the Sharpfin Webpanel "Install Addon" flow? Just be a bit confused how to deal with the zip file as I thought Sharpfin wants HTTP URLs to get a install script.

@Trashwarez
Copy link

Guys, can you tell me a bit more how to install it? Do I use the Sharpfin Webpanel "Install Addon" flow? Just be a bit confused how to deal with the zip file as I thought Sharpfin wants HTTP URLs to get a install script.

You have to unzip the archive and upload it's unpacked content (a bzip2 tar file with the extension "install") to your radio.
Upload can be done by using the Sharpfin web panel (you need a web server to provide the content) or the software you used to patch the radio.

@ChrizZz90
Copy link

same for me, get still the gateway error message but after some seconds the P1 starts.

@ymienert
Copy link
Author

ymienert commented Oct 30, 2021

this simple script can't suppress or avoid the reciva message. It let only the message disappear after a while. For a complete avoid we've to patch the "ir" binary. Thats for sure a very diffcould process. Further ideas, approach or concepts are highly welcome.

@ymienert
Copy link
Author

Update: V2

  • now alarm clock is fixed, after some beeping the station on P1 is comming up
  • Reciva error message disapears now faster
  • backlight is no longer flashing at the stand by mode
    LetsPlayP1_V2.zip

@Trashwarez
Copy link

V2 works fine here!
I am curious about how the connection attempts to Reciva are managed and if it's hardcoded in a compiled executable or an entry in a bash script. I did not find the file. Did you?

@jisotalo
Copy link
Owner

jisotalo commented Oct 31, 2021

I tested the script with Tangent Quattro but it's not working.

However, I also have noticed that the remote control buttons at sharpfin page aren't working. So that's probably the reason.

Any idea why they aren't working? Can't change presets or anything using the webpage.

EDIT: It seems that it's a common problem with tangent quattro and some installing is needed: https://iradioforum.net/forum/index.php?topic=2115.msg18964#msg18964 Need to check later..

@ymienert
Copy link
Author

@jisotalo: yes i've to confirm - my script is calling the sharpfin web server based remote controll buttons by perl calls. So is a fine working remote control mandatory. At first you should check if the lirc process running: at a telnet windows you could call "ps -a" and you should find a line like " 139 root 1480 S /usr/sbin/lircd -d /dev/lirc/0 /etc/config/lircd_conf". The next step could be to check if the needed files ("/usr/sbin/lircd" + "/etc/config/lircd_conf" are avaible. Keep us informed please.

@ymienert
Copy link
Author

@Trashwarez: like almost all reciva files is the "ir" binary located at "/root". Yes, laso my first thoughts was to change some scripts to get a working alert radion again. But indeed all functions around the radio interface are hard coded.

@oysterbay73
Copy link

oysterbay73 commented Nov 28, 2021

I've installed v2 on an Ipdio tune (model 663, not mini) and it mostly works. However, the detection doesn't seem to be quite right so it triggers again and reloads whilst already listening, including when on another preset (so reverts to 1). I've just edited the script installed in the /mnt/debug and added exit 0 once it's run the button presses. So this is better than nothing, it now tunes when you first turn radio on ac power. If you turn off/on radio itself then the script doesn't start again so it won't tune. Also just a note that I also found I could remove the 1st 2 button presses (select, back), back, back, 1 is sufficient with my config at least.

@oysterbay73
Copy link

Update and now all good by combining the above with a config change:

Option:
wifi-standby-power-menu
on

Which gives you a new menu option in network config settings allowing wifi to be switched on/off in standby. If you switch this on then when you bring the radio out of standby it will go straight to whatever you were last listening to. Downside is that it uses more power to keep wifi connected in standby.

@rjkolvoort
Copy link

rjkolvoort commented Jan 16, 2022

I almost trashed my IPDio Tune (model 663), but found out about Sharpfin just in time and successfully installed it. What made the change complete is the V2 script of ymienert with the additions of oysterbay73. It all works problem free so far. Thanks to the wifi-standby-power-menu it now switches on and off without any delay. Simply perfect! Thank you both so much for saving my IPDio from the garbage dump.

Update:
It appears that with the wifi-standby-power-menu on, the radio randomly switches on by itself.

@adn77
Copy link

adn77 commented Jan 29, 2022

I tried the script as well - a very smart idea in fact :)

Yet I have discovered that the script is not required if you do the following:

  • plug in power
  • press "back" until you're in the main menu
  • press Station 1 (now Station 1 should be playing)
  • now go to the Mediaplayer item in the menu (or use the (web)remote to do that)
  • turn the radio off (soft power-off)
  • turn the radio back on (it should not complain about not being able to connect to Reciva now, since you're in the Media Player menu)
  • press "ch list" on the (web)remote control (radio is not able to connect to Reciva but it is NOT restarting!!!)
  • Station 1 should be playing and the radio can now be turned off/on/off.... :)

Looks like a long procedure, in the essence it means turn the radio off in Media Player mode, and after turning back on you should be all set.

@adn77
Copy link

adn77 commented Jan 29, 2022

As I like to remote reboot the radios daily in order to overcome the wifi weakness, I took @ymienert 's idea and replaced the start_listening_pos1.sh script with the following:

#!/bin/sh
until ping -c1 1.1.1.1 > /dev/null 2>&1; do : sleep 1 ; done

curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=N&name=Back' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=N&name=Back' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=n&name=Mediaplayer' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=O&name=Power' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=O&name=Power' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=m&name=Channellist' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=C&name=P1' > /dev/null
sleep 1
curl -q 'http://127.0.0.1/cgi-bin/control.cgi?com=O&name=Power' > /dev/null

I can now have my HomeAutomation issue a http://recivaradio/cgi-bin/radio_Power_Reboot.cgi in the middle of the night. :D

@rjkolvoort
Copy link

rjkolvoort commented Jan 30, 2022

I did a few minor but essential changes to the script of ymienert in order to make it work really stable.

First run "top" in telnet and ...

  1. Check if it lists "./ir" or "ir". Change line 22 accordingly.
  2. Check the position of the CPU load and correct the "cut" character positions in line 31.
  3. Monitor the CPU load for a while

Make the necessary changes:
Line 22: top -n 1 | grep "./ir" > top_report.txt
Line 31: cpu_load_str=$(echo $line1 | cut -c35-36)
Line 39: in the first if statement use a CPU load well below the CPU load shown by top.

Next to these changes I corrected the first curl command to "com=N&name=Back" (the N) and reduced the sleep times from 2 to 1 second.
Of course you can play around with the curl commands used for the remote control commands to your liking.

These changes made ymienerts's script run stable and reliably on 3 Tangent Quattro's (one MK1 and two MK2's) and my IpDio Tune.

There is no need for this modification in the configxxx.txt file:

Option:
wifi-standby-power-menu
on

Again many thanks to ymienert for this smart script.

Addition:
In order to make the remote control commands work in the Tangent Quattro's add these lines to the config931.txt:

LIRC Module: /root/lirc_dev.o
LIRC Module: lirc_barracuda

@adn77
Copy link

adn77 commented Jan 30, 2022

As a note of caution, you should probably NOT use @ymienert 's script for too long as it constantly writes the ps output to the flash memory which causes it to age. (My radios are from 2008 and I already have quite a few bad blocks, even had to JTAG flash one of the radios to revive it).

If you still want to use the script (as opposed to the alternative I suggested above), have the scripts output to /tmpinstead.

@rjkolvoort
Copy link

As a note of caution, you should probably NOT use @ymienert 's script for too long as it constantly writes the ps output to the flash memory which causes it to age.

Thanks for your warning adn77. Never thought about aging of flash memory. I will give your suggestion a try.

@Z2430
Copy link

Z2430 commented Mar 3, 2022

I installed script V2 in my ipdio tune. Upon power-up, a reciva error appears, then the message starting and tuning to preset 1. There is a problem, if i put the device in standby and switch on it returns to standby. Turn it back on again and go back to standby again, the third time it starts up.
Anyone have the same problem?

@rjkolvoort
Copy link

Same here. But not always. It is a bit random and not serious enough to really bother me. I am not sure it has much to do with ymienrt's script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants