Infowidget IP address

Talk about YBoxen, widgets, Propeller hacking, etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
danico
 
Posts: 5
Joined: Thu Apr 16, 2009 3:36 am

Infowidget IP address

Post by danico »

Just got my Ybox2 up and running - great kit, all went together seamlessly, and working straight away. Now tinkering with the widgets, and have struck a problem setting the IP address in the infowidget.
My hosted domain has a 0 in its IP address, so when I change the SERVER_IPv4_ADDR to this address, when I compile with the Propeller Tool I get an error - "String characters must range from 1 to 255".

Anyone have any idas on how to work around this? (no, not going to rehost with a non zero IP!)

Thanks.

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Infowidget IP address

Post by adafruit »

oops haha thats a silly bug.. you could put in something else then connect to the webinterface to set the last byte.

User avatar
darco
 
Posts: 118
Joined: Wed Jun 04, 2008 7:54 pm

Re: Infowidget IP address

Post by darco »

The way to get around this bug is to put your IP address in a DAT section, give it a name, then set that value using settings.setData(). Yes, I know it sucks. Blame Parallax.

So it would look something like this:

Code: Select all

DAT
ipAddr        byte 192,168,0,1
PUB
setTheAddr()
  settings.setData(settings#SERVER_IPv4_ADDR,@ipAddr,4)

User avatar
danico
 
Posts: 5
Joined: Thu Apr 16, 2009 3:36 am

Re: Infowidget IP address

Post by danico »

Had to go away for a few days, but now back and have tried the offered solutions.

Using the web interface did work, nice quick and easy, but wanted the unit to power up correctly without having into input the data.

Thanks for the solution Darco, did as you suggested, and worked fine, although one slight change.
Set the ipAddr in a DAT section as suggested, but to set the value just removed the line from the original code and added the line as suggested.

' settings.setData(settings#SERVER_IPv4_ADDR,string(72,14,176,143),4)
settings.setData(settings#SERVER_IPv4_ADDR,@ipAddr,4)

Works fine, can read from my domain now.
Next is to create the pages to be displayed. First will be similar weather info, as used in the infowidget, but for Australian weather.

Thanks again for the help!

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Re: Infowidget IP address

Post by adafruit »

hmm, the web interface should be 'permanent' that is once you set it via web it should stick

Locked
Please be positive and constructive with your questions and comments.

Return to “YBox2 (discontinued)”