Raspberry Pi 2 support

2,368 views
Skip to first unread message

Eric PTAK

unread,
Feb 9, 2015, 5:13:49 PM2/9/15
to web...@googlegroups.com
Hi all,

At this time, I cannot confirm yet that WebIOPi will work out of the box on the RPi2 due to the CPU change. Actually there is a risk of unexpected behavior.
As far as I know, you must process to a fresh install. Don't try to use your existing SD. You will have to manually copy your WebIOPi configuration and scripts on a fresh SD card setup.

I'm waiting for my RPi2 shipment, then I should be able to see if the limitation are the same as A/B+ models (additional GPIO) or if there is specific issue.
In the meantime, I suggest to be very careful.

If anyone tried, please report your result.

Best,

neuralassembly

unread,
Feb 9, 2015, 10:52:02 PM2/9/15
to web...@googlegroups.com
Hi, 

I tried WebIOPi 0.7.0 on my Raspberry Pi 2,
but it did not work.
When I see the "GPIO Header", 
"IN/OUT" buttons do not show any strings,
and, by clicking them, nothing takes place.

I think that the changes of RPi.GPIO might be helpful.

Sincerely,
neuralassembly

Eric PTAK

unread,
Feb 10, 2015, 4:42:43 AM2/10/15
to web...@googlegroups.com
Ok thanks.

--
You received this message because you are subscribed to the Google Groups "WebIOPi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webiopi+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adminstrator MfasteR

unread,
Feb 12, 2015, 10:18:10 AM2/12/15
to web...@googlegroups.com

FYI

Alain

unread,
Feb 12, 2015, 4:53:34 PM2/12/15
to web...@googlegroups.com
Hi Lucky  P2 owner,

I also installed an "adapted" version of  WebIOPi 0.7.0, same result as 'neuralassembly'.

But I must say that the same "adaptation" on a B+ board work perfectly ! See the attached pictures.

Processor change  or  Device Tree ?
B2-board.PNG
B+board.PNG

Richard Sipe

unread,
Feb 24, 2015, 6:53:02 PM2/24/15
to web...@googlegroups.com
I have tried to install 0.7.1 on my Pi2 and it is giving me a "Sorry, you are running this installer on an unsupported platform ..." error

Interesting thing is I am able to get Weaved running but it detects the PI2 as a BeagleBone I am pretty sure because they both have armv7 processor archs? Anyways Weaved does work but it doesn't seem that WebIOPi currently does.

If you need anybody to test anything for you just let me know. I have a Pi2 and a B+ here.

Eric PTAK

unread,
Feb 28, 2015, 8:51:59 AM2/28/15
to web...@googlegroups.com
RPi2 support is in progress, I received mine few days ago.

Kayhan BELEK

unread,
Mar 2, 2015, 2:05:33 PM3/2/15
to web...@googlegroups.com
Hi Alain,

Where can I download "adapted" version of wbiopi?
Thanks in advance.

12 Şubat 2015 Perşembe 23:53:34 UTC+2 tarihinde Alain yazdı:

Toshi Bass

unread,
Mar 2, 2015, 3:36:34 PM3/2/15
to web...@googlegroups.com
A simple search for b+ would have done the trick, but look here https://groups.google.com/d/msg/webiopi/tKrjHxR_mOI/vwPc7vuBPNQJ note this is just a hack to get the additional pins on the b+ to show and function on the Webiopi GPIO-monitor it doesn't appear to function on the pi2 for that you will have to wait for Eric to release an update to the Webiopi code.


neuralassembly

unread,
Mar 19, 2015, 3:41:20 AM3/19/15
to web...@googlegroups.com
Hi trouch,

I appllied the following patch to WebIOPi 0.7.1 ,
and it worked fine on my Raspberry Pi 2 with Raspbian 2015-02-16.

Are there any problems before the next release?

Sincerely,

neuralassembly

##############################################
diff -ruN WebIOPi-0.7.1.orig/python/native/cpuinfo.c WebIOPi-0.7.1/python/native/cpuinfo.c
--- WebIOPi-0.7.1.orig/python/native/cpuinfo.c  2012-10-29 06:26:10.000000000 +0900
+++ WebIOPi-0.7.1/python/native/cpuinfo.c       2015-03-18 16:50:19.479997210 +0900
@@ -37,7 +37,10 @@
    while(!feof(fp)) {
       fgets(buffer, sizeof(buffer) , fp);
       sscanf(buffer, "Hardware : %s", hardware);
-      if (strcmp(hardware, "BCM2708") == 0)
+      if (strcmp(hardware, "BCM2708") == 0 ||
+          strcmp(hardware, "BCM2709") == 0 ||
+          strcmp(hardware, "BCM2835") == 0 ||
+          strcmp(hardware, "BCM2836") == 0)
          rpi_found = 1;
       sscanf(buffer, "Revision : %s", revision);
    }
diff -ruN WebIOPi-0.7.1.orig/python/native/gpio.c WebIOPi-0.7.1/python/native/gpio.c
--- WebIOPi-0.7.1.orig/python/native/gpio.c     2013-02-04 07:04:18.000000000 +0900
+++ WebIOPi-0.7.1/python/native/gpio.c  2015-03-18 16:48:52.769997243 +0900
@@ -20,6 +20,7 @@
 SOFTWARE.
 */

+#include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
 #include <string.h>
@@ -29,8 +30,8 @@
 #include <pthread.h>
 #include "gpio.h"

-#define BCM2708_PERI_BASE   0x20000000
-#define GPIO_BASE           (BCM2708_PERI_BASE + 0x200000)
+#define BCM2708_PERI_BASE_DEFAULT  0x20000000
+#define GPIO_BASE_OFFSET           0x200000
 #define FSEL_OFFSET         0   // 0x0000
 #define SET_OFFSET          7   // 0x001c / 4
 #define CLR_OFFSET          10  // 0x0028 / 4
@@ -71,6 +72,22 @@
 {
     int mem_fd;
     uint8_t *gpio_mem;
+    uint32_t peri_base = BCM2708_PERI_BASE_DEFAULT;
+    uint32_t gpio_base;
+    unsigned char buf[4];
+    FILE *fp;
+
+    // get peri base from device tree
+    if ((fp = fopen("/proc/device-tree/soc/ranges", "rb")) != NULL) {
+        fseek(fp, 4, SEEK_SET);
+        if (fread(buf, 1, sizeof buf, fp) == sizeof buf) {
+            peri_base = buf[0] << 24 | buf[1] << 16 | buf[2] << 8 | buf[3] << 0;
+
+        }
+        fclose(fp);
+    }
+
+    gpio_base = peri_base + GPIO_BASE_OFFSET;

     if ((mem_fd = open("/dev/mem", O_RDWR|O_SYNC) ) < 0)
     {
@@ -83,7 +100,7 @@
     if ((uint32_t)gpio_mem % PAGE_SIZE)
         gpio_mem += PAGE_SIZE - ((uint32_t)gpio_mem % PAGE_SIZE);

-    gpio_map = (uint32_t *)mmap( (caddr_t)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, mem_fd, GPIO_BASE);
+    gpio_map = (uint32_t *)mmap( (caddr_t)gpio_mem, BLOCK_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_FIXED, mem_fd, gpio_base);

     if ((uint32_t)gpio_map < 0)
         return SETUP_MMAP_FAIL;
##############################################

Tudor D

unread,
Mar 19, 2015, 12:28:36 PM3/19/15
to web...@googlegroups.com
Please give the newbies a little help, how to apply this patch? Copy to a patch file in the Webiopi 0.7.1 directory and...?

Azfer Ah Seng

unread,
Mar 30, 2015, 11:11:01 AM3/30/15
to web...@googlegroups.com
Hi neuralassembly,
I just found this thread and I have the same issue where the GPIO Header "IN/OUT" buttons are missing. I am using Pi 2 with WebIOPi 0.7.1 latest from Google code. What is the steps to fix this? Also I have purchased Weaved Pro Account and I can see my devices running with WebIOPi, SSH and Web. 

Please help.

Thanks

Alain

unread,
Apr 5, 2015, 11:43:30 AM4/5/15
to web...@googlegroups.com
Hi all,
I copied the patch from 'neuralassembly', but was never able to apply it correctly. It works for the 'gpio.c' file, but not for the 'cpuinfo.c' file.
 So under Ubuntu I edited 'cpuinfo.c' to apply the diffs and now WebIOPi works fine !
In order to give everybody this solution I compressed those 2 files. You just need to 'untar' those and replace the originals ones in the directory '.../WebIOPi-0.7.0/python/native/,
 (or into .../WebIOPi-0.7.1/....) both releases use the same files!
Of course, before this, you must also apply the patch proposed for the B+ board, it's here patch for B+ board

Then you will have to 're-install WebIOPi, exactly like proposed for the B+ patch, remember:

stop the deamon before  re-compilation: sudo /etc/init.d/webiopi stop
if you already installed WebIOPi, recompile by running the command:

from into the WebIOPi-0.7.0 directory: sudo ./setup.sh skip-apt


..and it must work


friendly

Alain

gpio.c.tar.gz
cpuinfo.c.tar.gz
Message has been deleted

Richard Sipe

unread,
Apr 16, 2015, 1:58:59 PM4/16/15
to web...@googlegroups.com
Just got around to revisiting this on my Pi 2 and it worked like a charm! I copied over the two files in Alain's previous post and then ran the patch from the other thread and everything worked. The installer gave me a warning that my device wasn't supported and didn't autostart the Weaved installer but it all seems to work just fine. Thanks!

Adam S

unread,
Apr 16, 2015, 2:07:47 PM4/16/15
to web...@googlegroups.com
That's good to hear, my Pi2 should arrive tomorrow or Saturday.  I'm planning on making an easy to follow guide to getting webiopi installed and patches applied once it shows up

Adam S

unread,
Apr 20, 2015, 1:43:52 PM4/20/15
to web...@googlegroups.com
I got my Pi2 and ran the install and all patches and I am getting the following when starting a blank default webiopi server using "sudo webiopi -d -c /etc/webiopi/config" and navigating to GPIO Header or GPIO List.  Is this to be expected, or should this work?

----------------------------------------
Exception happened during processing of request from ('10.0.0.189', 49159)
Traceback (most recent call last):
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.1-py3.2-linux-armv7l.egg/webiopi/protocols/http.py", line 238, in processRequest
    result = self.server.handler.do_GET(relativePath, compact)
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.1-py3.2-linux-armv7l.egg/webiopi/protocols/rest.py", line 147, in do_GET
    return (200, self.getJSON(compact), M_JSON)
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.1-py3.2-linux-armv7l.egg/webiopi/protocols/rest.py", line 245, in getJSON
    gpios[gpio][f] = GPIO.getFunctionString(gpio)
NameError: global name 'GPIO' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.2/socketserver.py", line 295, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python3.2/socketserver.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python3.2/socketserver.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python3.2/socketserver.py", line 648, in __init__
    self.handle()
  File "/usr/lib/python3.2/http/server.py", line 396, in handle
    self.handle_one_request()
  File "/usr/lib/python3.2/http/server.py", line 384, in handle_one_request
    method()
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.1-py3.2-linux-armv7l.egg/webiopi/protocols/http.py", line 267, in do_GET
    self.processRequest()
  File "/usr/local/lib/python3.2/dist-packages/WebIOPi-0.7.1-py3.2-linux-armv7l.egg/webiopi/protocols/http.py", line 258, in processRequest
    except (GPIO.InvalidDirectionException, GPIO.InvalidChannelException, GPIO.SetupException) as e:
NameError: global name 'GPIO' is not defined
----------------------------------------

Alto_Gmail

unread,
Apr 21, 2015, 5:19:49 PM4/21/15
to web...@googlegroups.com
Hi Adam
error messages at the compilation already, shows you are using WebIOPi 0.7.1. ! So something is wrong in the config.
I never used this release and the "iomotix" option, and your problem seems coming from that option (http protocol).
I still use the release 0.7.0 from WebIOPi, with "no-ip" as Dynamic Update Client for my Internet access.
And both accesses  (private network and Internet /public netwok) works fine either for WebIOPi, for the PiCam or to access shared directories from the Raspi.

Tip: take care when you edit your files in Windows, Python do not accept non UTF8 character ! After many such "surprises" I switched definitively under a Linux environment (Ubuntu & gedit) to play with the Raspi !
good luck
Alain Tornare
--
You received this message because you are subscribed to a topic in the Google Groups "WebIOPi" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/webiopi/jB8d7ix3qXc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to webiopi+u...@googlegroups.com.

Adam S

unread,
Apr 22, 2015, 8:18:36 AM4/22/15
to web...@googlegroups.com
Hmm...so you're saying just use the 0.7.0 version?  According to the patch notes 0.7.1 added only weaved support, so the patches should work fine for 0.7.1 too. 

I'll give 0.7.0 a try and report back.

Tudor D

unread,
Apr 22, 2015, 11:55:18 AM4/22/15
to web...@googlegroups.com
I've had the same error and the only solution was to restart from a clean copy of  the operating system.

RaspiConfig with no device tree.

Copy the Webiopi 0.7.1 kit, untar, apply both patches, install and launch.

The only issue I have is that if I try to activate a PWM PCA9685 board connected by i2c Webiopi is crashing. This is somehow related to the i2c-2708 module that is referring to a chip that was replaced by bcm2709 I think.

Adam S

unread,
Apr 22, 2015, 12:30:04 PM4/22/15
to web...@googlegroups.com
I think I'll just sit on my Pi2 for a bit until Eric gets an update out.  Nothing worse than chasing your tail over stuff that doesn't work.

Toshi Bass

unread,
Apr 22, 2015, 12:39:37 PM4/22/15
to web...@googlegroups.com

Me too, I didn't even try this so called fix it all seams a bit pointless if you already have a standard pi working, Eric said iomotix should be out by June, no idea if he's on target though.

Toshi
.

Eric PTAK

unread,
Apr 30, 2015, 2:28:39 PM4/30/15
to web...@googlegroups.com
sorry for taking so looong guys !

--
You received this message because you are subscribed to the Google Groups "WebIOPi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webiopi+u...@googlegroups.com.

Nitin Patil

unread,
Aug 11, 2015, 10:33:52 AM8/11/15
to WebIOPi
HI, M newbie here..
I install weaved on Raspberry Pi B model. But when I login on weaved and try to click on link of my created "alise" but it opens blank page.

Why it is so... ???
please suggest me solution for it.

Toshi Bass

unread,
Aug 11, 2015, 10:50:45 AM8/11/15
to WebIOPi
Reply all
Reply to author
Forward
0 new messages