# No such device found

**URL:** <https://forums.digi.com/t/no-such-device-found/2686>\
**Category:** Python\
**Created:** [November 26, 2008, 4:35pm UTC](https://forums.digi.com/t/no-such-device-found/2686 "2008-11-26T16:35:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ummi](https://avatars.discourse-cdn.com/v4/letter/u/f07891/32.png) [@ummi](https://forums.digi.com/u/ummi)\
**Post date:** [November 26, 2008, 4:35pm UTC](https://forums.digi.com/t/no-such-device-found/2686/1 "2008-11-26T16:35:01Z")

</div>

Hi,

I am trying to write to a file using python. Its a simple program,

import sys  
logfile = open(“/134.36.17.245/test.log”, ‘w’)  
logfile.write(‘test succeeded’)  
logfile.close()  
print file(‘test.log’).read()

logfile = open(‘test.log’, ‘a’)  
logfile.write(‘line 2’)  
logfile.close()  
print file(‘test.log’).read()

After running the code, I am getting the error,

IOError: [Errno 19] No such device: ‘/134.17.36.245/test.log’

Please help me with this code…

Ummi

---

<div class="post-metadata">

**Author:** ![52637p](https://avatars.discourse-cdn.com/v4/letter/5/c6cbf5/32.png) [@52637p](https://forums.digi.com/u/52637p)\
**Post date:** [November 26, 2008, 4:42pm UTC](https://forums.digi.com/t/no-such-device-found/2686/2 "2008-11-26T16:42:30Z")

</div>

The filesystem in these devices is limited, so understanding what operation you are intending will help determine whether what you are trying is feasible.

Are you hoping to have a directory per “endpoint” (identified by IP address) with a file in that directory named “test.log”, where the directory is found at the top level of the root voluem?

---

<div class="post-metadata">

**Author:** ![ummi](https://avatars.discourse-cdn.com/v4/letter/u/f07891/32.png) [@ummi](https://forums.digi.com/u/ummi)\
**Post date:** [November 26, 2008, 6:20pm UTC](https://forums.digi.com/t/no-such-device-found/2686/3 "2008-11-26T18:20:39Z")

</div>

Actually I am trying to record temperature and light smaples from wallrouter on to the file. The program I have is:

import sys  
import time  
sys.path.append(“WEB/python/DigiXBeeDrivers.zip”)

# Import the library from the zip file

import xbeewr  
import zigbee

# The Xbee Wallrouter’s hardware address

DESTINATION = “[00:13:a2:00:40:34:13:05]!”

# Create a sensor object

wallrouter = xbeewr.XBeeWRN(DESTINATION)

# Retrieve a sample reading from the wallrouter

for i in range (1,50):  
sample = wallrouter.sample()  
print “Temperature (Degrees) :”, sample[‘temperature’]  
print “Light (LUX) :”, sample[‘light’]  
print  
time.sleep(1800)

Instead of writing these samples on the screen, I am trying to write them on a file.

To do that I was trying that little program to see if its possible to write on a file in PC connected to connectport X2 over the ethernet.

Please advice..

Ummi

---

<div class="post-metadata">

**Author:** ![52637p](https://avatars.discourse-cdn.com/v4/letter/5/c6cbf5/32.png) [@52637p](https://forums.digi.com/u/52637p)\
**Post date:** [November 26, 2008, 8:32pm UTC](https://forums.digi.com/t/no-such-device-found/2686/4 "2008-11-26T20:32:43Z")

</div>

In your context, the “open” call attempts to open a file in the embedded filesystem of the device.

The standard “open” is not a mechanism for manipulating files across a network.

You need to consider what software will be listening for your log messages on the remote machine that receives them. That software choice will dictate what (if any) software modules would need to be incorporated to communicate. This “simple” operation is, unfortunately, not trivial.
