mikethechap / webiopi Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/webiopi
Automatically exported from code.google.com/p/webiopi
It is obvious that we can determine the Raspi board revision remotely by
looking at the number at position 3 in Mapping[1] or Mapping[2] when requesting
this by /webiopi/map. However, the map answer is a longer string requiring some
pattern-matching so determine stable and robust if the number at position 3 is
a 0 or a 2.
It would be much more simple by adding this code to the doGet() method in
webiopi.py:
# revision
elif relativePath == "revision":
self.send_response(200)
self.send_header("Content-type", "text/plain")
self.end_headers()
revision = "%s" % GPIO.BOARD_REVISION
self.wfile.write(revision.encode())
The HTTP answer would just be a plain "1" or "2" (assuming that cpuinfo.c does
its job correct) which is much more straight to use.
Original issue reported on code.google.com by [email protected]
on 20 Dec 2012 at 8:28
Add a config file :
- Login/Password
- Startup script
- Default state with default server
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:46
If you want to control webiopi with your IPhone/IPad you can use every button
only once. After activating and deactivating a buttonk, they stop working.
Tested on an IPhone 5 (6.0) and IPad 3 (6.0.1)
Original issue reported on code.google.com by [email protected]
on 26 Nov 2012 at 5:23
Hello,
I added the following to clients.py so I could poll temperatures from my
onewire sensor... thought you might find it useful also.
def inputtempf(self, channel):
return float(self.sendRequest("GET", "/devices/temp%d/temperature/f" % channel))
Thank you,
Kewlj1313
Original issue reported on code.google.com by [email protected]
on 14 Feb 2013 at 4:19
What steps will reproduce the problem?
1. Continuously sending from the Gertboard's Atmel to the Raspberry
2. Opening http://.../app/serial-monitor
3. The input of the serial port does not show up though sending works (i.e. the
config file has ttyAMA0 enabled and webiopi was called with the -c <configfile>
switch)
WebIOPi version used?
=> Latest git read-only checkout version as of 09/05/2013
Python version used?
=> Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=> 2013-02-09-wheezy-raspbian.zip
Raspberry Pi board revision? (1 or 2)
=> 2
For Javascript side bugs, Browser?
=> firefox, linux
Please provide any additional information below.
The response type for GET in the read function has not been defined, therefore
the function returned an XML Document instead of a file.
Adding
from webiopi.decorators.rest import request, response
and the @response line in:
@request("GET", "")
@response("%s")
def read(self):
Solves the problem. Attached, the changed file.
Thanks for your great work on webiopi!
Original issue reported on code.google.com by [email protected]
on 9 May 2013 at 6:55
Attachments:
What steps will reproduce the problem?
1. Disconnect from access to DNS
2. Start webiopi with: "sudo python -m webiopi"
What is the expected output? What do you see instead?
The expected response is that webiopi starts normally with the hostname set to
'localhost'
Actual response:
pi@raspberrypi ~/webiopi/WebIOPi-0.5.3 $ sudo python -m webiopi
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 489, in <module>
main(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 481, in main
server = Server(port=port, passwdfile=passwdfile)
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 106, in __init__
self.host = getLocalIP()
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 98, in getLocalIP
except (socket.error, e):
NameError: global name 'e' is not defined
What version of the product are you using? On what operating system?
0.5.3 on Raspbian
Please provide any additional information below.
The fix is the change line 98 of python/webiopi.py to:
except socket.error as e:
and reinstall. I found I had to manually remove the directory python/build
before the setup would reinstall correctly.
Original issue reported on code.google.com by [email protected]
on 10 Feb 2013 at 12:59
When stopping webiopi after having changed any input to an output you get a
warning like "RuntimeWarning: This channnel ....." from the RPi.GPIO module
when you restart the module.
If you add "RPi.GPIO.cleanup() (or RPi.cleanup() in the latest file in the
trunk path) to the code that stops the http server (direct before or after
server.stop()) then this waring disappears.
This will reset all GPIO settings you change with webiopi, but you do that
anyway right now when initializing your module, so this should not be a problem.
Best regards
Original issue reported on code.google.com by [email protected]
on 28 Sep 2012 at 1:48
Add SPI Support
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:49
What steps will reproduce the problem?
1. Fresh install of Wheezy (latest version as of 2/17/2013
2. Go to Pi Store
3. Install Webiopi
What is the expected output? What do you see instead?
I expected Webiopi to be installed, I got an error in terminal instead.
Please provide any additional information below.
I'm not sure what the issue is, I've Googled it to death and didn't get any
results. The error in terminal says
urlib.error.URLError: urlopen [Errorno - 5] No address associated with hostname
I have run apt-get update and even tried installing this through the tar.gz
package here. The error remains the same. After I get the error a browser
window opens and says error connecting to page. I'm not sure if I have to
download anything else to get the webpage to open, I haven't owned an Rpi for
long.
Original issue reported on code.google.com by AndroidianLabs
on 17 Feb 2013 at 9:32
See http://www.raspberrypi.org/phpBB3/viewtopic.php?t=36670&p=315941
Original issue reported on code.google.com by [email protected]
on 28 Mar 2013 at 10:18
Add I2C support throught /dev/i2c-x or /dev/mem
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:48
What steps will reproduce the problem?
1. yum install python-devel python3 python3-devel
2. Download, unpack, install webiopi
What is the expected output? What do you see instead?
[root@rpi ~]# python -m webiopi
/bin/python: No module named webiopi
[root@rpi ~]# python3 -m webiopi
/bin/python3: No module named webiopi
What version of the product are you using? On what operating system?
WebIOPi-0.5.3
Raspberry-PI Fedora 17 Remix (Linux rpi 3.2.27 #1 PREEMPT Mon Oct 1 22:37:41
UTC 2012 armv6l armv6l armv6l GNU/Linux)
Python 2.7.3 + Python 3.2.3
PS. Later i reinstalled it and found error:
unable to execute gcc: No such file or directory
error: command 'gcc' failed with exit status 1
Build for Python 3.2.3 failed\n
WebIOPi installed for Python 3.2.3\n
Copying resources... OK\n
WebIOPi successfully installed
* You can use it with Python 2.7.3\t: sudo python -m webiopi
* You can use it with Python 3.2.3\t: sudo python3 -m webiopi
But why "WebIOPi successfully installed" if it obviosly failed?
Original issue reported on code.google.com by [email protected]
on 8 Jan 2013 at 8:29
The sample code provided at https://code.google.com/p/webiopi/wiki/HTML doesn't
work at following buttons:
a. The switch and LED buttons don't work.
Also, there isn't any examples/custom/index.html file.
What steps will reproduce the problem?
1. Install the webiopi as described in
https://code.google.com/p/webiopi/wiki/INSTALL
2. Copy .html code from https://code.google.com/p/webiopi/wiki/HTML and put it
in index.html in /usr/share/webiopi/htdocs
3. access the code at raspberrypi:8000
...
WebIOPi version used?
=>0.6.0
Python version used?
=>2.7
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>Raspbian Wheezy
Raspberry Pi board revision? (1 or 2)
=>2
For Javascript side bugs, Browser?
=>
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 16 Apr 2013 at 4:02
When using e.g. digital I/O port IC's in many cases its necessary so set them
up as input or output. Moreover, in some cases they may also provide the
possibility to enable pull-ups or pull-downs. This setting-up can be done in
custom macros with python api calls, but it would be much simpler to provide
this as config option. For GPIOS there is already the option in config.
A parameter scheme for e.g. setting up 8 digital IO's could just be
IIOOIOB_
where I = Input, O = Output, B = Bidirectional (like PCF8574), _ = default
For Pullup resistors this could be
UUUNDD_N
where U = Pullup enabled, D = Pulldown enabled, N = No pullup, _ = default again
As this options need some parsing this will be a little bit more effort to
implement.
Original issue reported on code.google.com by [email protected]
on 25 Feb 2013 at 11:48
Please expand the function of the input pins to a counter that is incremented
on the rising or falling edge and a function to reset the counter.
I thank you and congratulate you on this great project!
Original issue reported on code.google.com by [email protected]
on 3 Feb 2013 at 11:11
Hi Eric,
when developing my driver for TSL2561 I imported the curent trunk (r885) into
PyDev within Eclipse. When looking at the files the error checker found some
potential errors which I want to give you to check before releasing 0.5.4.
coap.py
Line 45:
- getCode(format): missing self, should be: getCode(self, format):
- same for toString() just below
bus.py
Line 79:
- return "Bus(%s, %s)" % (busName, device) should be: return "Bus(%s, %s)" %
(self.busName, self.device)
rest.py
Line 311:
- return (404, fname + " Not Found", M_PLAIN) should be: return (404, mname + "
Not Found", M_PLAIN)
utils.py
Line 192:
- except (socket.error, e): should be: except (socket.error): (not sure about
this but "e" seems to be undefined)
Best regards
Andreas
Original issue reported on code.google.com by [email protected]
on 9 Feb 2013 at 7:00
Happy new year and thanx for the ongoing work with webiopi.
I have done some implementation work with custom python server modules now and
implemented a way that helps to make this task easier for me. Maybe we can
share this with other users of webiopi server modules.
I implemented a server module called webiopi_mysrv.py that has all necessary
things inside it to be run as server module in interactive mode (development
time) as well in deamon mode (just runtime). I place this module in a known
path (e.g. /home/pi/webiopi_mysrv/ and register it once with a custom
webiopi_mysrv.py.init (see attachments) that gets installed as webiopi_mysrv in
/etc/init.d/ the usual way. This way that module can be started and stopped as
deamon or even automatically at startup without having to do the installation
stuff too often. I also can run it in interactive mode and stop in with CTRL-C
during development and bugfixing. I can have multiple different versions of
webiopi_mysrv.py and just by renaming them I can test different alternatives
even in deamon mode without having to do the installation stuff again and again.
I also discovered that when my module is terminated in deamon mode, the
cleaning up code at the end is not executed. For that reason I added some code
that catches the SIGTERM when the module is terminated in deamon mode so that
my cleanup code is also executed in this case. I have attached a version of
webiopi_mysrv.py that is implemented according to demo.py but contains all the
stuff that makes server initialization and finalization more streamlined and
does cleanup the same way in interactive and deamon mode to be consistent. It
also contains mode comments for others to understand how to use it and adds an
example macro without parameters for completeness of pythton server module
usage possibilities.
Maybe this is a good improvement for the python server module example and its
usage documentation.
Best regards.
Original issue reported on code.google.com by [email protected]
on 4 Jan 2013 at 10:26
Attachments:
What steps will reproduce the problem?
1. Copy /etc/init.d/webiopi on a custom folder
2. copy /etc/webiopi/config on the same folder as step 1
3. edit webiopi script that you copied in step 1 and configure it to use config
file that you copied on step 2
4. on config file copied in step 2 disable CoAP server setting enabled to false
and disabling also multicasting
5. on config file configure your personal script in [SCRIPTS] section
6. if tcp port 8000 is already in use change it to 8081 (just for example)
7. launch webiopi startup script in your custom folder, python will daemonize,
your script will be loaded, your tcp port will be used according your
configuration BUT... CoAP server will be launched too even if disabled.
WebIOPi version used?
=>0.6.0
Python version used?
=>2.7.3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>Raspbian Wheezy
Raspberry Pi board revision? (1 or 2)
=>2
For Javascript side bugs, Browser?
=>Google Chrome but it's the same
I could disable CoAP changing /etc/webiopi/config but when I tried to use
another config file located in my project folder I could set everything I
needed but not disabling CoAP server.
I could set disabled in the file but when launching the daemon CoAP is launched
anyway.
Original issue reported on code.google.com by [email protected]
on 5 Apr 2013 at 11:19
webiopi.js still has the Google Analytics code, with a hard coded account id.
Might be an idea to either comment it out or remove altogether.
Original issue reported on code.google.com by [email protected]
on 24 Mar 2013 at 8:08
Give ability to schedule tasks:
* Macro
* GPIO trigger
* GPIO pulse
* PWM output
Only macro scheduling is required as everything can be done in python macros.
REST mapping is easy : /schedule/$date/$RESTURI
/schedule/2013-01-11-23-59/GPIO/0/value/1
/schedule/*-*-*-*-*-0/macros/myMacro
Add Javascript functions to hide REST calls
Add schedule saving
Original issue reported on code.google.com by [email protected]
on 10 Jan 2013 at 11:10
Hi Eric, what do you think about CORS support (for making cross domain ajax
calls possible without additional proxys)?
Here you will find some infos about cors
http://www.html5rocks.com/en/tutorials/cors/ and here I found a phyton server
with cors in github: https://gist.github.com/gkatsev/3796275
WebIOPi version used?
=> 6
Python version used?
=> 3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=> Wheezy
Raspberry Pi board revision? (1 or 2)
=> 1
For Javascript side bugs, Browser?
=> Crome,FF20
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 14 May 2013 at 8:17
What steps will reproduce the problem?
1. Install WebIOPi
2. Schedule to run at startup as per the instructions
3. Reboot
At this point I observe the service running, but non responsive on port 8000.
WebIOPi version used?
=> Unknown, one from the store
Python version used?
=> Unknown, one that came with the distro
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=> Wheezy
Raspberry Pi board revision? (1 or 2)
=> Rev 2
For Javascript side bugs, Browser?
=> N/A
Please provide any additional information below.
Suggested fix:
* Add $network to the startup dependancies, fixed it for me.
Original issue reported on code.google.com by [email protected]
on 27 Feb 2013 at 7:38
What steps will reproduce the problem?
1. Install webiopi with instructions from readme
2. Browse to http://<IP>/webiopi/
3. Login, nothing happens
What is the expected output? What do you see instead?
In js console Uncaught Error: NOT_FOUND_ERR: DOM Exception 8 line 81
(head.insertBefore(style, scripts[0]);)
What version of the product are you using? On what operating system?
0.5.3 on raspberry wheezy
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 18 Feb 2013 at 7:53
Attachments:
In bridge.c the comment on line 184
// python function output(channel, value)
shoud be something like
// python function outputSequence(channel, period, sequence)
Original issue reported on code.google.com by [email protected]
on 18 Dec 2012 at 9:18
Super boulot, merci beaucoup juste 2 details:
1. Wrong Spelling of Celsius in sensor.py
2. Line 23 of sensor.py also a wrong spelling of the method "def
__getCelius__(self):"
What version of the product are you using? On what operating system?
r874
Best regards
Michael Burget
Original issue reported on code.google.com by [email protected]
on 7 Feb 2013 at 10:37
Add parameter configuration possibilities to HttpURLConnection:
// Timing parameters
urlConnection.setReadTimeout(...);
urlConnection.setConnectTimeout(...);
// Sometimes needed for POST, some HTTP servers complain if nothing is
// posted (like webiopi does) but content-type is unset
urlConnection.setRequestProperty("Content-Type", "text/plain");
// Avoid zipping
urlConnection.setRequestProperty("Accept-Encoding", "identity");
// Cache management
urlConnection.setUseCaches(false);
Add HTTP (and maybe CoAP) response handling management possibilities:
// Error handling
urlConnection.getResponseCode();
urlConnection.getResponseMessage();
// allow direct JSON response switching by detecting response mime type
urlConnection.getContentType();
Put those values into a RestResponse Object that may also contain the response
result itself.
Java (partly Python) client lacks:
- "*", /map, /version, /revision
- /sequence and /pulse for NativeGPIO
- all /devices/name/*/... paths
- /macro
- /...... generic like for e.g. routes
- JSON response handling helpers
Hope that helps just as a proposal list.
Andreas
Original issue reported on code.google.com by [email protected]
on 5 Apr 2013 at 2:53
Add UART Support to WebIOPi
- Can already be used with pyserial and /dev/ttyAMA0
- Need to add UART enabling/disabling
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:48
Exception happened during processing of request from ('192.168.1.122', 61073)
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 638, in __init__
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 469, in do_GET
self.processRequest()
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 466, in processRequest
raise e
UnicodeDecodeError: 'utf8' codec can't decode byte 0x89 in position 0: invalid
start byte
Original issue reported on code.google.com by [email protected]
on 11 Jan 2013 at 10:31
First of all, many thanks for making this software available.
I am not a php programmer, so forgive me if I’ve missed something obvious. My
index.html page looks as the sample, but with no info as to a pin being high or
low—simply an empty grey box. My log shows
"PHP Parse error: syntax error, unexpected '[' in /var/www/webiopi/gpio.php on
line 19"
This on a Linux raspi 3.1.9+ #90 Wed Apr 18 18:23:05 BST 2012 armv6l GNU/Linux
Thanks much.
Original issue reported on code.google.com by [email protected]
on 22 Aug 2012 at 5:52
What steps will reproduce the problem?
1. Install WebIOPi
2. install hostapd and udhcpd to make Pi as Wireless Access Point
3. WebIOPi work well with wire plugged. Unplug the wire and reboot. Cannot
access http://pi:8000/webiopi/
What is the expected output? What do you see instead?
-> It should work well both wiring and wireless
What version of the product are you using? On what operating system?
-> Raspberry both model A and B. Tenda 150N USB wireless. Raspbian “wheezy”
update 2013-02-09. Browser are Safari on iPhone, Chrome on iPhone, Safari 6.0.2
on OSX 10.8.2
Original issue reported on code.google.com by [email protected]
on 16 Feb 2013 at 1:46
What steps will reproduce the problem?
1. create an ajax request to the http rest api, using another server even
locally with different port
2. initiate the requset, and you will get CORS error
3.
...
WebIOPi version used?
=>
Python version used?
=>
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>
Raspberry Pi board revision? (1 or 2)
=> 1
For Javascript side bugs, Browser?
=>
Please provide any additional information below.
Need to enable CORS headers on python server side, or allow jsonp return of
data. I am attempting to communicate to the raspberry pi's GPIO via REST but
since my nodeJs http server is running on port 80 and the webiopi is running on
port 8000 it causes a CORS issue. JSONP wont work as data is transmitted as
text/plain and callback is dropped.
Original issue reported on code.google.com by [email protected]
on 30 Mar 2013 at 8:45
What steps will reproduce the problem?
1. Install the webiopi module (in Arch ARM, it ends up in
/usr/lib/python2.7/site-packages/_webiopi)
2. Run `python2.7 -m webiopi 8000'
3. This results in an ImportError: No module named _webiopi.GPIO (traceback
shown at the bottom)
This can be fixed by adding a blank __init__.py file to the _webiopi module
===
WebIOPi version used?
=> 0.5.3
Python version used?
=> 2.7
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=> Arch ARM
Raspberry Pi board revision? (1 or 2)
=> 2
For Javascript side bugs, Browser?
=> Firefox
Please provide any additional information below.
Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/webiopi.py", line 32, in <module>
import _webiopi.GPIO as GPIO
ImportError: No module named _webiopi.GPIO
Original issue reported on code.google.com by [email protected]
on 4 Mar 2013 at 7:04
Will it be possible to add to the REST API an option to change the state of a
pin for x seconds? As example: "HTTP POST /GPIO/(gpioNumber)/value/(0 or
1)/xxxx" where xxxx is the seconds the pin will be on or off and after the xxxx
second the pin will return to the old state.
When this is possible it will be so incredible great. My knowledge of python is
not large enough to program it myself.
Thanks in advance.
Original issue reported on code.google.com by [email protected]
on 10 Dec 2012 at 8:47
Hi Eric,
I just made a WebIOPi 0.5.3 fresh install with a fresh Raspbian 2012-12-16
image to have a clean setup. The installation with setup.sh failed because it
was unable to apt-get the python development heders (both for python 2.7 and
python3). I assume some package authentication failure as the shell reported
something like that.
Doing a manual sudo apt-get install -y --force-yes python3-dev solved the
problem for me. Maybe this option has to be added to the setup.sh or a hint to
optionally update the package authentication (I dont know the commend right
now) may help.
Regards Andreas
Original issue reported on code.google.com by [email protected]
on 16 Jan 2013 at 8:01
ENHANCEMENT - Patch against Rev 605
Really like webiopi. I am planning to use it as the basis of a swimming pool
control server. To do this I am using a Dallas 1-Wire temperature sensor. I
decided I might as well add 1-Wire functionality to webiopi if I have to write
it anyway.
The patch is based on the w1-gpio module. The first thing it does is detect if
the module is loaded and if so turns GPIO pin 4 into ALT mode to stop it being
used. It adds at the bottom of the table a list of all detected 1-Wire devices
and lets you read from them. The raw data is displayed or by checkbox can have
the temperature extracted.
I have updated the RESTAPI docs to show what you can do. 1-Wire can be enabled
or disabled which loads or unloads the w1-gpio module. A list of devices can be
requested and then the data for a deviceId can be taken. This is easily
manipulated by Javascript like extracting the temperature.
The webiopi main page will show the 1-wire devices below the GPIOs only when it
is enabled. The list is updated dynamically so new devices will appear when
they have been connected with no user intervention. They will also be removed
when disconnected.
I only have one device so have only tested with that but it should work with
many. It will only work with devices that give data in the w1_slave file. It
does not support writing to devices but it could be added easily.
Hope it is useful to others. Any comments welcome.
Original issue reported on code.google.com by [email protected]
on 28 Nov 2012 at 8:37
Attachments:
What steps will reproduce the problem?
1. Connect a Dallas (or any one wire temp sensor)
2. Cool the sensor down below 10 degrees C
3. Try to access the temperature via a rest query.
What is the expected output? What do you see instead?
Expected: A temperature
Instead:
Error response
Error code: 403
Message: invalid literal for int() with base 10: '=5062'.
What version of the product are you using? On what operating system?
r894 on RaspberryPi
Please provide any additional information below.
I located the issue and was able to get it working again. This is caused in
the sensor.py file by the following:
def __getCelsius__(self):
data = self.read()
lines = data.split("\n")
if lines[0].endswith("YES"):
temp = lines[1][-5:]
return int(temp) / 1000.0
lines[1][-5:] is expecting 5 characters but when the sensor is below 10 degrees
C it returns integers such as 9550.
I was able to fix it by doing the following strip of the = sign:
def __getCelsius__(self):
data = self.read()
lines = data.split("\n")
if lines[0].endswith("YES"):
temp = lines[1][-5:]
temp = temp.strip('=')
return int(temp) / 1000.0
Thank you!
Kewlj1313
Original issue reported on code.google.com by [email protected]
on 14 Feb 2013 at 4:15
I would like to have support for different interface methods like contrling
things with checkboxes/radiobuttons.
It would be very nice if you add something like webiopi().createCheckbox...
Thanks for your efforts!
Original issue reported on code.google.com by [email protected]
on 31 Dec 2012 at 3:47
When I try to follow the installation instruction to update the python
development header, there are several files cannot be fetched and returned 404
error. Anyone can help?
Original issue reported on code.google.com by [email protected]
on 20 Dec 2012 at 8:52
What steps will reproduce the problem?
1. install newest 2013-02-09-wheezy-raspbian.zip
2. upgrade and update components
3. install webiopi
...
WebIOPi version used?
=> 0.5.3
Python version used?
=>Python 2.7.3 (default, Jan 13 2013, 11:20:46)
[GCC 4.6.3] on linux2
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=>2013-02-09-wheezy-raspbian
Raspberry Pi board revision? (1 or 2)
=> 2
For Javascript side bugs, Browser?
=>not yet
Please provide any additional information below.
setup.log attached
In file included from /usr/include/features.h:356:0,
from /usr/include/limits.h:27,
from /usr/lib/gcc/arm-linux-gnueabihf/4.6/include-fixed/limits.h:169,
from /usr/lib/gcc/arm-linux-gnueabihf/4.6/include-fixed/syslimits.h:7,
from /usr/lib/gcc/arm-linux-gnueabihf/4.6/include-fixed/limits.h:34,
from /usr/include/python2.7/Python.h:19,
from native/bridge.c:23:
/usr/include/arm-linux-gnueabihf/sys/cdefs.h:1:1: error: stray ‘\4’ in
program
/usr/include/arm-linux-gnueabihf/sys/cdefs.h:1:2: error: expected identifier or
‘(’ before numeric constant
/usr/include/arm-linux-gnueabihf/sys/cdefs.h:1:2: error: stray ‘\203’ in
program
/usr/include/arm-linux-gnueabihf/sys/cdefs.h:1:2: error: stray ‘\342’ in
program
/usr/include/arm-linux-gnueabihf/sys/cdefs.h:1:2: error: stray ‘\6’ in
program
/Build for Python 2.7.3 failed
....
Original issue reported on code.google.com by lolo8304
on 21 Feb 2013 at 10:33
Attachments:
CherryPy will improve HTTP handling and allow WebSocket as well as long polling
Original issue reported on code.google.com by [email protected]
on 27 Mar 2013 at 11:59
Debian packages will speed up install by removing python-dev, setuptools and
compilation process.
Original issue reported on code.google.com by [email protected]
on 28 Mar 2013 at 12:05
Hi.
I am running a Webiopi server inside a Python script and using a custom
index.html.
After I uploaded from 0.5.1 to 0.5.3, everytime the page finishes loading from
a browser, I get a UnicodeDecodeError on the terminal from where I ran the
script. The page is loaded normally, though, and the server keeps running.
Here it is what I get:
Traceback (most recent call last):
File "/usr/lib/python2.7/SocketServer.py", line 284, in _handle_request_noblock
self.process_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 310, in process_request
self.finish_request(request, client_address)
File "/usr/lib/python2.7/SocketServer.py", line 323, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python2.7/SocketServer.py", line 638, in __init__
self.handle()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 340, in handle
self.handle_one_request()
File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
method()
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 469, in do_GET
self.processRequest()
File "/usr/local/lib/python2.7/dist-packages/WebIOPi-0.5.3-py2.7-linux-armv6l.egg/webiopi.py", line 466, in processRequest
raise e
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 62: invalid
start byte
Any thoughts?
PS: This also happens when I run the default index.
Thanks!
Original issue reported on code.google.com by macecchi
on 17 Jan 2013 at 4:00
What steps will reproduce the problem?
1. Run WebIOPi as a service
2. Wait 24hours using it intermittently
3. Try to access it.. it is still running but does not respond.
WebIOPi version used?
One in the store (latest I think)
Python version used?
Unknown
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
Wheezy
Raspberry Pi board revision? (1 or 2)
Rev 2
For Javascript side bugs, Browser?
N/A
Please provide any additional information below.
Original issue reported on code.google.com by [email protected]
on 2 Mar 2013 at 11:28
What steps will reproduce the problem?
1. Wrong Voltage for example MCP3008 connected to 5V reference.
2.
3.
...
WebIOPi version used?
=> 0.6.0
Python version used?
=> python3
Distro used? (WebIOPi has only been tested on Raspbian Wheezy)
=> Raspbian Wheezy
Raspberry Pi board revision? (1 or 2)
=> 2
For Javascript side bugs, Browser?
=>
Please provide any additional information below.
I have am MCP3008 connected via I2C to my Raspberry Pi. As i have a different
power Supply for this i connected everything to 5V. Well your Software is
really great but i found out that the Voltage was shown false with 3.3 Volt
maximum.
I found out that this was hard coded in your Code. It would be cool if we could
set this reference Voltage in the mail config file.
Original issue reported on code.google.com by [email protected]
on 18 Apr 2013 at 2:55
What steps will reproduce the problem?
How can I change GPIO (4) direction to out at RI boot
I'm using this code but GPIO 4 is in IN mode at startup
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.o$
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content = "height = device-height, width = 420, u$
<title>WebIOPi | Control your Pi's GPIO</title>
<script type="text/javascript" src="/webiopi.js"></script>
<script type="text/javascript">
webiopi().ready(function() {
var content, button;
content = $("#content");
WebIOPi.prototype.map(4,"OUT",0);
button = webiopi().createGPIOButton(4, "1");
content.append(button);
});
function mousedown() {
webiopi().setValue(4, 1);
}
function mouseup() {
webiopi().setValue(4, 0);
}
</script>
<style type="text/css">
button {
display: block;
margin: 5px 5px 5px 5px;
width: 360px;
height: 45px;
font-size: 24pt;
font-weight: bold;
color: White;
}
#gpio7.LOW {
background-color: White;
}
#gpio7.HIGH {
background-color: Red;
}
</style>
</head>
<body>
<div id="content" align="center"></div>
</body>
</html>
Raspberry Pi board revision? (1 or 2)
=>2
Original issue reported on code.google.com by [email protected]
on 4 Mar 2013 at 7:40
Config options for devices allow setting of parameters like I2C slave address.
(Currently) they have to be in the right order as they are used in __init__ of
the device class. Sometimes lets say I want to change the 3rd parameter. In
order to do this its also necessary to provide the 1st and 2nd parameter even
if they can keep their defualt values. One possibility would be to copy the
parameter=value scheme from __init__ into config. But that would be heavy
additionally parsing effort.
A simple solution would be to allow e.g. "*" as placeholders for parameters
that can keep their default values from __init__. The number/sequence of
parameters will still have to be the correct one (trailing ones not nedded to
be changed at the end can be ommitted), but errors arising from wrong
hard-coded default values in config can be avoided.
Example
mydevice = DEVICECLASS * * 13
On implementation side, the code that scans config parameters could just pass
"None" on all parameter positions that can keep default values so that the
__init__ values provide the missing value again.
Original issue reported on code.google.com by [email protected]
on 25 Feb 2013 at 11:34
- Add getValue(gpio)
- Add getFunction(gpio)
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:44
Optimize push
- Long Polling ?
- Cometd / Bayeux ?
- WebSocket ?
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:52
>>> from webiopi.clients import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/WebIOPi-0.6.0-py2.6-linux-x86_64.egg/webiopi/__init__.py", line 17, in <module>
import _webiopi.GPIO as GPIO
_webiopi.GPIO.SetupException: This module can only be run on a Raspberry Pi!
Original issue reported on code.google.com by [email protected]
on 15 Apr 2013 at 6:32
Add edge dection support
Original issue reported on code.google.com by [email protected]
on 23 Nov 2012 at 3:50
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.