Home/Support/Support Forum/Appending Text File on Network with Xbee Sensor Data Through Gateway

Appending Text File on Network with Xbee Sensor Data Through Gateway

0 votes
I have a Python script for collecting XBee sensor data and appending a comma delimited text file. Right now I only am able to append a text file that resides within the XBee gateway memory. I'd like to be able to append a text file on our All_User network for general access by anyone.

I'm using Digi ESP to write code. The simplest thing I have tried is:

with open("//ourServerName/ourDataFolder/ourData.csv", "a") as ourFile:

ourFile.write(ourData %s\r\n)


All this yields is a file on the XBee gateway named "//ourServerName/ourDataFolder/ourData.csv"

I've looked up Python IO commands online and have tried tried different things with os.path.xxxx and either receive an IOError errno 2, no such file or directory, or get an odd named file on the XBee gateway.

Any suggestions would be apreeciated.
asked Apr 8, 2015 in XBee Programmable Development by radio_davio New to the Community (1 point)

Please log in or register to answer this question.

1 Answer

0 votes
This depends on what gateway you are using. I don't know that any gateway supports access to network shares (someone else can chime in if I'm wrong). But the X2e variants do provide scp which you can use to upload/download files. So set up an ssh/scp server on your local network and script around scp from python in order to upload the file to your share.
answered Apr 12, 2015 by jlovinger Veteran of the Digi Community (421 points)
edited Apr 12, 2015 by jlovinger
It is a 50X2E-Z3C.  I'm not versed in setting up ssh/scp servers, but a quick google search looks like it can be figured out.  Is there some way anyone knows how to simply append a file, though.  Like the saying goes, I am the lazy man trying to find the simplest way.