btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2014
11:39 AM
Write IP to tmp
Attempting to use the roDeviceInfo to get an IP Address from the Roku and write it to a tmp file. I have the following:
di= CreateObject("roDeviceInfo")
WriteAsciiFile("tmp:/iploc.txt", di.GetIPAddrs())
When I run this I get a type mismatch on the WriteAsciiFile line. Not sure what the problems is. Any ideas or suggestions appreciated.
Thanks
di= CreateObject("roDeviceInfo")
WriteAsciiFile("tmp:/iploc.txt", di.GetIPAddrs())
When I run this I get a type mismatch on the WriteAsciiFile line. Not sure what the problems is. Any ideas or suggestions appreciated.
Thanks
4 REPLIES 4

TheEndless
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2014
01:05 PM
Re: Write IP to tmp
WriteAsciiFile requires a string. GetIPAddrs() returns an associative array, where "eth0" is the wired IP address, and "eth1" is the wireless IP address.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2014
10:11 AM
Re: Write IP to tmp
Is there a way to write the ip to a txt file which is located on my server? I understand what you are saying about the array and string. I have been able to isolate the value of eth1 but when I attempt to use WriteAsciiFile I get and invalid path. I have the txt file located on my server:
WriteAsciiFile("http://xxx.xxx.x.x:port/iploc.txt", myip)
The file does exist and I am capable of clicking on the link and opening the file. When the code runs though I get invalid path. Just need to save the roku's ip some way for future access.
Thanks
WriteAsciiFile("http://xxx.xxx.x.x:port/iploc.txt", myip)
The file does exist and I am capable of clicking on the link and opening the file. When the code runs though I get invalid path. Just need to save the roku's ip some way for future access.
Thanks


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2014
10:40 AM
Re: Write IP to tmp
"btpoole" wrote:
Is there a way to write the ip to a txt file which is located on my server? I understand what you are saying about the array and string. I have been able to isolate the value of eth1 but when I attempt to use WriteAsciiFile I get and invalid path. I have the txt file located on my server:
WriteAsciiFile("http://xxx.xxx.x.x:port/iploc.txt", myip)
The file does exist and I am capable of clicking on the link and opening the file. When the code runs though I get invalid path. Just need to save the roku's ip some way for future access.
Thanks
WriteASCIIFile() is for writing to the local filesystem. If you need to send data to a server, you would use roURLTransfer to make a request to an API and the API would then do something useful with it like writing it to a file.
btpoole
Channel Surfer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2014
10:48 AM
Re: Write IP to tmp
Thank you for the info. Will go that way.