Giter Club home page Giter Club logo

Comments (19)

tackin avatar tackin commented on July 20, 2024 2

found it:
table.json was ok but radio_1.json was broken.
Works great!
I would suggest to show an error in the output in case a file cannot be parsed anymore. That could even show up in the radiomenu.

from radio-api.

tackin avatar tackin commented on July 20, 2024 1

Confirm! The image runs on arm64.
Raspi4 Debian GNU/Linux 11 (bullseye)

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024 1

I started a branch optim-issue-11 for better error handling while loading JSON files.

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

Hi,

I have a reposition https://github.com/kimbtech/WiFi-RadioAPI/blob/master/HamaAPI.md where I added some of the requests and answers my radio produces.
It might be interesting to compare the differences to the Dual radio.

So yes, I would be interested. However I can not promise to make Radio-API work with the other radio.

from radio-api.

tackin avatar tackin commented on July 20, 2024

Where/how would you like me to provide the dump?

After all I'm still not sure if Dual IR6 is even affected by the frontier-changes as it stores the favorites local on the radio and may therefore just keeping requesting for the stream-uri and keeps getting that answered from frontier without account.
But if not, it would be nice to be able to switch to Radio-API.

from radio-api.

tackin avatar tackin commented on July 20, 2024

I put it here for you:
https://nextcloud.digilay.duckdns.org/s/TSZrt5NASJWqiNi

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

Thanks, I downloaded the file.

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

Hi,

I checked the tcp dumps. The requests seem to be very similar to the ones of my radio. However, yours has the value dual for CONF_SETUPAPP_IDENT. May this be the cause of the problems?

I released a new version, which does not need to set CONF_SETUPAPP_IDENT anymore, see v2.3.12.

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

I just added ARM versions of the Docker Images to Docker Hub. I can't test them on a Raspberry Pi, but they will hopefully run.

from radio-api.

tackin avatar tackin commented on July 20, 2024

from radio-api.

tackin avatar tackin commented on July 20, 2024

But the Dual-Radio still does not work with Radio-API.
From the radio main-menu the first option is "stationlist>"
Pushing that, the radio requests for:
http://dual.wifiradiofrontier.com/setupapp/dual/asp/BrowseXML/loginXML.asp?gofile=&mac=fe9971bad537ca2b9820107a7dc41b73&dlang=eng&fver=4&ven=dual12

It will get a json-List and builds all its further menu-entries from this json.
i.e. "Favorites", which calls
http://shim-pri.wifiradiofrontier.com/vtuner/radios/favorites?&startItems=1&endItems=100&mac=fe9971bad537ca2b9820107a7dc41b73&dlang=eng&fver=4&ven=dual12
(Which might be blocked from Frontier in march for non payer.)

or "Local Germany", which calls
http://shim-sec.wifiradiofrontier.com/vtuner/radios/country/8777677923440934?&startItems=1&endItems=100&mac=fe9971bad537ca2b9820107a7dc41b73&dlang=eng&fver=4&ven=dual12

etc.

With rerouting to the local Radio-API-container it just tells me "Empty" on the screen because the Radio-API answers with an empty page.

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

Hi,

thats quite interesting. I do not get JSON responses and but get XML responses.

My radio sends similar requests and when I do the following request via my computer to wifiradiofrontier.com I get:

curl -v http://dual.wifiradiofrontier.com/setupapp/dual/asp/BrowseXML/loginXML.asp?gofile=&mac=xxxxxxx&dlang=eng&fver=4&ven=dual12

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListOfItems>
  <ItemCount>-1</ItemCount>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>My Favourites</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/radios/favorites?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/radios/favorites?</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Local Germany</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/radios/country/8777677923440934?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/radios/country/8777677923440934?</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Stations</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/radios?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/radios?</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Podcasts</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/feeds?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/feeds?</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>My added Stations</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/streams/favorites?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/streams/favorites?</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Help</Title>
    <UrlDir>http://shim-pri.wifiradiofrontier.com/vtuner/help?</UrlDir>
    <UrlDirBackUp>http://shim-sec.wifiradiofrontier.com/vtuner/help?</UrlDirBackUp>
  </Item>
</ListOfItems>

When I run a similar request to Radio-API, I get this similar and corresponding answer:

curl -v "http://radio.example.com/setupapp/dual/asp/BrowseXML/loginXML.asp?gofile=&mac=xxxxxxx&dlang=eng&fver=4&ven=dual12"

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<ListOfItems>
  <ItemCount>4</ItemCount>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Podcast</Title>
    <UrlDir>http://radio.example.com/cat?cid=3</UrlDir>
    <UrlDirBackUp>http://radio.example.com/cat?cid=3</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Radio</Title>
    <UrlDir>http://radio.example.com/cat?cid=1</UrlDir>
    <UrlDirBackUp>http://radio.example.com/cat?cid=1</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>Stream</Title>
    <UrlDir>http://radio.example.com/cat?cid=2</UrlDir>
    <UrlDirBackUp>http://radio.example.com/cat?cid=2</UrlDirBackUp>
  </Item>
  <Item>
    <ItemType>Dir</ItemType>
    <Title>GUI-Code: Zxxxx</Title>
    <UrlDir>http://radio.example.com/?go=initial</UrlDir>
    <UrlDirBackUp>http://radio.example.com/?go=initial</UrlDirBackUp>
  </Item>
</ListOfItems>

Just as hint: As far as I know, the value mac= in the urls is your personal token/ key. So you can may want to omit it here.

from radio-api.

tackin avatar tackin commented on July 20, 2024

The mac above is just random build for demo. ;-)

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

I just tested it locally (Docker container running on my computer in the local network with port 80 open).
There it works the way it should, e.g., with:
curl -v "http://192.168.0.99/setupapp/dual/asp/BrowseXML/loginXML.asp?gofile=&mac=fe9971bad537ca2b9820107a7dc41b73&dlang=eng&fver=4&ven=dual12"

If the API sends empty responses it might be a problem/ error with PHP or there might be messages from PHP.
Error messages are only shown when setting DEV=dev in the environment via docker-compose.

Does the web interface at http://192.168.0.99/gui/ work?

from radio-api.

tackin avatar tackin commented on July 20, 2024

Yes I get the page where I can put in my login-code.
But the login with a code from table.json than leads again to an empty page.

from radio-api.

tackin avatar tackin commented on July 20, 2024

Warning: Trying to access array offset on value of type null in /php-code/classes/Id.php on line 107

Fatal error: Uncaught TypeError: RedisCache::arraySet(): Argument #2 ($array) must be of type array, null given, called in /php-code/classes/Id.php on line 107 and defined in /php-code/classes/RedisCache.php:153 Stack trace: #0 /php-code/classes/Id.php(107): RedisCache->arraySet('macs', NULL) #1 /php-code/classes/Id.php(43): Id->loadFileIntoRedis(Object(RedisCache)) #2 /php-code/classes/Login.php(47): Id->__construct('ZUVqp', 3) #3 /php-code/gui/index.php(28): Login->loginByCode('ZUVqp') #4 {main} thrown in /php-code/classes/RedisCache.php on line 153

from radio-api.

tackin avatar tackin commented on July 20, 2024

I run 2 networks in that Radio-API container.

  1. mcvlan with an IP of my net (no ports exposed because not needed)
  2. default with a usual internal docker-bridge (no ports exposed as also not needed) to connect redis and Radio-API.

I get no log-errors in the container on startup. So redis should work fine.

from radio-api.

kimbtech avatar kimbtech commented on July 20, 2024

It looks as there is a problem with the table.json. It may contain a syntax error or similar, because currently PHP ist not able to parse it and thus uses a null value.

If your table.json does not contain any valuably information you may delete it and Radio-API will create a new one (when the radio connects).

from radio-api.

tackin avatar tackin commented on July 20, 2024

Ok I tested it.

  1. delete old table.json
  2. request http://192.168.0.123/setupapp/dual/asp/BrowseXML/loginXML.asp?gofile=&mac=xxxxxxx&dlang=eng&fver=4&ven=dual12
  3. Radio-API bulids new table
  4. Look into the table.json to read
},
    "codes": {
        "Zw6vs": 1
    }
  1. request http://192.168.0.123/gui
  2. insert Login-code: Zw6vs
  3. get back:
    Fatal error: Uncaught TypeError: Data::addCategoryToTable(): Argument #2 ($data) must be of type array, null given, called in /php-code/classes/Data.php on line 91 and defined in /php-code/classes/Data.php:108 Stack trace: #0 /php-code/classes/Data.php(91): Data->addCategoryToTable(1, NULL) #1 /php-code/classes/Data.php(34): Data->constructTable() #2 /php-code/classes/Inner.php(23): Data->__construct(1) #3 /php-code/gui/index.php(42): Inner->__construct(1) #4 {main} thrown in /php-code/classes/Data.php on line 108

from radio-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.