3

I am trying to define a simple python path, but I always get an error. Can someone please tell me how to set the correct path. I am working on a Raspberry Pi.

Here is the code that doesn't work:

import re, os, rrdtool, time, sys


# define pathes to 1-wire sensor data
pathes = "/sys/bus/w1/devices/10-000801ddae93/w1_slave"

and

# insert data into round-robin-database
rrdtool.update(
"%s/temperature.rrd" % (os.path.dirname(os.path.abspath(__file__))),
data)

the errors I get:

07/27/15 13:21:37 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:39 Error reading y :  [Errno 2] No such file or directory: 'y'
07/27/15 13:21:40 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:41 Error reading / :  [Errno 21] Is a directory: '/'
07/27/15 13:21:42 Error reading b :  [Errno 2] No such file or directory: 'b'
07/27/15 13:21:44 Error reading u :  [Errno 2] No such file or directory: 'u'
07/27/15 13:21:45 Error reading s :  [Errno 2] No such file or directory: 's'
07/27/15 13:21:46 Error reading / :  [Errno 21] Is a directory: '/'
07/27/15 13:21:48 Error reading w :  [Errno 2] No such file or directory: 'w'
07/27/15 13:21:49 Error reading 1 :  [Errno 2] No such file or directory: '1

' etc.....

and

Traceback (most recent call last):
  File "/home/pi/python.py", line 39, in <module>
    data)
error: /home/pi/temperature.rrd: found extra data on update argument: U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U:U

I hope U can help me.

User01
  • 31
  • 1
  • What does line 39 of python.py say? What do you expect `os.path.dirname(os.path.abspath(__file__)` to compute to? – saulspatz Jul 27 '15 at 13:44

1 Answers1

0

update() probably expects a list type, or something you can iterate over.

Try ...update([.... ])