Page 1 of 1
PHP Notice: Undefined index?
Posted: Sat 18 May 2013 2:03 am
by n9mfk
Hi,
how do I avoid this error when I restart cumulus
Code: Select all
PHP Notice: Undefined index: txbattery channel=1
Code: Select all
$vpissstatus = $WX['txbattery channel=1'];
thanks Beau
Re: PHP Notice: Undefined index?
Posted: Sat 18 May 2013 9:15 am
by gemini06720
In order to produce the result you want, you will need to create a new tag (variable) in the 'CUtags.txt' template as such:
Code: Select all
vpissstatus|<#txbattery channel=1>:|:
The reason you cannot use the 'channel=1' option with the '$WX['txbattery']' is that the variable has already been assigned a value (ie: 'TX Battery Status: 1-ok 2-ok 3-ok 4-ok 5-ok 6-ok 7-ok 8-ok ').
If you do not want to add a new tag to the 'CUtags.txt' template, then you will have to use 'explode' function and/or other functions to extract the individual values contained - although not fancy, I used the following two steps:
Code: Select all
list( $txbs, $results ) = explode( ':', $WX['txbattery'] );
list( $tx1, $tx2, $tx3, $tx4, $tx5, $tx6, $tx7, $tx8 ) = explode( ' ', $results );
The '$txbs' variable contains the 'TX Battery Status' message, the '$results' contains the '1-ok 2-ok 3-ok 4-ok 5-ok 6-ok 7-ok 8-ok' data, and finally, the '$tx1' to '$tx8' variables contain the data from the possible 8 transmitters.
Re: PHP Notice: Undefined index?
Posted: Sun 19 May 2013 2:08 pm
by n9mfk
Hi Ray,
I had added but for some reason when i restarted cumulus i got the php index error
Beau
Re: PHP Notice: Undefined index?
Posted: Sat 01 Jun 2013 7:07 pm
by BigOkie
I know I'm about two weeks late to the party here, but I've used Ken's templates before when I used WD. I got a VP2 station earlier this month and have been using Cumulus (and like it). What I did to add station specific status for the ISS was put this in the CUtags.txt file
Code: Select all
DavisISS1|<#txbattery channel=1>:|:
then in the CUDefs.php file tied a variable I named $dvisschan1 to that by this line:
After that, it worked just fine. You could theoretically just continue to add the channels in the def and txt file so you wouldn't have to worry about using the explode function in PHP.
Just a thought.
Re: PHP Notice: Undefined index?
Posted: Sun 02 Jun 2013 4:04 pm
by PaulMy
BigOkie good to see you here and your 1st post, and looks like you are enjoying your new Davis. I have been following the recent discussions at wxforum.net on tornados in your area and wish you safe weather watching and being safe from the disasters and tragedies that have been occurring there.
Paul
Re: PHP Notice: Undefined index?
Posted: Sun 02 Jun 2013 7:58 pm
by BigOkie
PaulMy wrote:BigOkie good to see you here and your 1st post, and looks like you are enjoying your new Davis. I have been following the recent discussions at wxforum.net on tornados in your area and wish you safe weather watching and being safe from the disasters and tragedies that have been occurring there.
Paul
It has been a wild couple of weeks here for sure. I have, however, lived here my whole life and understand the dangers of the weather here. Just keeps us Okies on our toes. Still horrible what has happened here. My immediate location really has been spared (except for Broken Arrow, about 6 miles to my SE).
Thanks for the concern.