mkschreder / juci

JUCI JavaScript Webgui for embedded devices running OpenWRT
Other
389 stars 108 forks source link

You do not have an RPC connection to the router! 2 #62

Closed JangAlla closed 3 years ago

JangAlla commented 8 years ago

Thank you for project!!

But there is a little problem.

When you try to access the Web interface, comes the following statement.

-> You do not have an RPC connection to the router!

F12

  1. Console message

01-juci.js:57 RPC init 01-juci.js:56 connecting to rpc server at (ws://192.168.20.18/websocket/) 01-juci.js:56 WebSocket connection to 'ws://192.168.20.18/websocket/' failed: Error during WebSocket handshake: Unexpected response code: 404RevoRPC.$connect @ 01-juci.js:56doConnect @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1async.eachSeries @ 01-juci.js:1_asyncMap @ 01-juci.js:1(anonymous function) @ 01-juci.js:1async.series @ 01-juci.js:1JUCIMain.$init @ 01-juci.js:57(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29ready @ 01-juci.js:29I @ 01-juci.js:29 01-juci.js:56 connection failed!socket.onerror @ 01-juci.js:56 01-juci.js:57 could not connect to rpc interface(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56 01-juci.js:57 UCI Init 01-juci.js:56 Init UCI 01-juci.js:56 No uci rpc object present!UCI.$init @ 01-juci.js:56(anonymous function) @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56 01-juci.js:56 connection closed!socket.onclose @ 01-juci.js:56 01-juci.js:57 UCI failed to initialize!(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:57 JUCI Init 01-juci.js:57 init: config 01-juci.js:56 Could not sync config juci(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:57 Using settings from config/juci on router 01-juci.js:57 skipping menu init 01-juci.js:57 CONF 01-juci.js:57 juci: angular init 01-juci.js:56 Could not sync config firewall(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config hosts(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config wireless(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config system(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config upnpd(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56

404 -> Request URL:ws://192.168.20.18/websocket/ Request Method:GET Status Code:404 Not Found

help me~

mkschreder commented 8 years ago

make sure you have built snd installed orangerpcd package.

On 23 Sep 2016 03:06, "JangAlla" notifications@github.com wrote:

Thank you for project!!

But there is a little problem.

When you try to access the Web interface, comes the following statement.

-> You do not have an RPC connection to the router!

F12

  1. Console message

01-juci.js:57 RPC init 01-juci.js:56 connecting to rpc server at (ws://192.168.20.18/websocket/) 01-juci.js:56 WebSocket connection to 'ws://192.168.20.18/websocket/' failed: Error during WebSocket handshake: Unexpected response code: 404RevoRPC.$connect @ 01-juci.js:56doConnect @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1async.eachSeries @ 01-juci.js:1_asyncMap @ 01-juci.js:1(anonymous function) @ 01-juci.js:1async.series @ 01-juci.js:1JUCIMain.$init @ 01-juci.js:57(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29ready @ 01-juci.js:29I @ 01-juci.js:29 01-juci.js:56 connection failed!socket.onerror @ 01-juci.js:56 01-juci.js:57 could not connect to rpc interface(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56 01-juci.js:57 UCI Init 01-juci.js:56 Init UCI 01-juci.js:56 No uci rpc object present!UCI.$init @ 01-juci.js:56(anonymous function) @ 01-juci.js:57(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1iterate @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:1(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29socket.onerror @ 01-juci.js:56 01-juci.js:56 connection closed!socket.onclose @ 01-juci.js:56 01-juci.js:57 UCI failed to initialize!(anonymous function) @ 01-juci.js:57j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:57 JUCI Init 01-juci.js:57 init: config 01-juci.js:56 Could not sync config juci(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:57 Using settings from config/juci on router 01-juci.js:57 skipping menu init 01-juci.js:57 CONF 01-juci.js:57 juci: angular init 01-juci.js:56 Could not sync config firewall(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config hosts(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config wireless(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config system(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56 01-juci.js:56 Could not sync config upnpd(anonymous function) @ 01-juci.js:56j @ 01-juci.js:29fireWith @ 01-juci.js:29e.(anonymous function) @ 01-juci.js:29(anonymous function) @ 01-juci.js:56

help me~

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiSy7hvgXozL4qrb8mt0kPRkmbGexks5qsyYOgaJpZM4KEg24 .

JangAlla commented 8 years ago

Thanks reply.

um.. orangerpcd was installed.

Below is the status of my openwrt(Chaos Calmer 15.05.1)

1.process state root@L28K:/tmp/log/lighttpd# ps PID USER VSZ STAT COMMAND 1 root 1436 S /sbin/procd 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0] 5 root 0 SW< [kworker/0:0H] 6 root 0 SW [kworker/u2:0] 7 root 0 SW< [khelper] 65 root 0 SW< [writeback] 67 root 0 SW< [bioset] 70 root 0 SW< [kblockd] 72 root 0 SW [kswapd0] 73 root 0 SW [kworker/0:1] 74 root 0 SW [fsnotify_mark] 160 root 0 SW [spi32766] 188 root 0 SW< [deferwq] 265 root 0 SW [kworker/0:2] 270 root 0 SW [kworker/u2:2] 326 root 0 SWN [jffs2_gcd_mtd6] 466 root 900 S /sbin/ubusd 614 root 1492 S /bin/ash --login 764 root 0 SW< [ipv6_addrconf] 783 root 0 SW< [cfg80211] 916 root 1056 S /sbin/logd -S 16 934 root 1568 S /sbin/rpcd 970 root 1640 S /sbin/netifd 994 root 1192 S /usr/sbin/odhcpd 1024 root 1148 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 1041 http 4136 S /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf 1095 root 28320 S /usr/bin/orangerpcd -p /usr/lib/orange/api/ 1108 root 1484 S udhcpc -p /var/run/udhcpc-eth0.2.pid -s /lib/netifd/ 1118 root 804 S odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 eth0. 1271 root 1808 S /usr/sbin/hostapd -P /var/run/wifi-phy0.pid -B /var/ 1299 nobody 1000 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /va 1429 root 1488 S /usr/sbin/ntpd -n -S /usr/sbin/ntpd-hotplug -p time. 1676 root 1484 R ps

2.ltghttpd log

root@L28K:/tmp/log/lighttpd# cat error.log 2016-09-22 21:01:23: (log.c.216) server started

3.Web folder

root@L28K:/www# ls cgi-bin favicon.ico img initfail.html reboot.html css fonts index.html js

root@L28K:/www/js# ls 01-juci.js 50-juci-network-netifd.js 50-juci-ddns.js 50-juci-openwrt-wireless.js 50-juci-dnsmasq-dhcp.js 50-juci-samba.js 50-juci-dropbear.js 50-juci-snmpd.js 50-juci-ethernet.js 50-juci-sysupgrade.js 50-juci-event.js 50-juci-uhttpd.js 50-juci-firewall-fw3.js 50-juci-upnp.js 50-juci-macdb.js 50-juci-usb.js 50-juci-minidlna.js 50-juci-utils.js 50-juci-mod-status.js 60-juci-simple-gui.js 50-juci-mod-system.js 80-juci-theme-openwrt.js

4. router config folder

root@L28K:/etc/config# ls dhcp firewall juci network rpcd wireless dropbear fstab jucid orange system

mkschreder commented 8 years ago

Check browser console and see what the web server is returning as response code for /websocket/ url. If it is an error then most likely you did not install the version of lighttpd that comes with the juci feed. You need to reinstall that and build again.

On 23 Sep 2016 09:43, "JangAlla" notifications@github.com wrote:

Thanks reply.

um.. orangerpcd was installed.

Below is the status of my openwrt(Chaos Calmer 15.05.1)

1.process state root@L28K:/tmp/log/lighttpd# ps PID USER VSZ STAT COMMAND 1 root 1436 S /sbin/procd 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0] 5 root 0 SW< [kworker/0:0H] 6 root 0 SW [kworker/u2:0] 7 root 0 SW< [khelper] 65 root 0 SW< [writeback] 67 root 0 SW< [bioset] 70 root 0 SW< [kblockd] 72 root 0 SW [kswapd0] 73 root 0 SW [kworker/0:1] 74 root 0 SW [fsnotify_mark] 160 root 0 SW [spi32766] 188 root 0 SW< [deferwq] 265 root 0 SW [kworker/0:2] 270 root 0 SW [kworker/u2:2] 326 root 0 SWN [jffs2_gcd_mtd6] 466 root 900 S /sbin/ubusd 614 root 1492 S /bin/ash --login 764 root 0 SW< [ipv6_addrconf] 783 root 0 SW< [cfg80211] 916 root 1056 S /sbin/logd -S 16 934 root 1568 S /sbin/rpcd 970 root 1640 S /sbin/netifd 994 root 1192 S /usr/sbin/odhcpd 1024 root 1148 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 1041 http 4136 S /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf 1095 root 28320 S /usr/bin/orangerpcd -p /usr/lib/orange/api/ 1108 root 1484 S udhcpc -p /var/run/udhcpc-eth0.2.pid -s /lib/netifd/ 1118 root 804 S odhcp6c -s /lib/netifd/dhcpv6.script -P0 -t120 eth0. 1271 root 1808 S /usr/sbin/hostapd -P /var/run/wifi-phy0.pid -B /var/ 1299 nobody 1000 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /va 1429 root 1488 S /usr/sbin/ntpd -n -S /usr/sbin/ntpd-hotplug -p time. 1676 root 1484 R ps

2.ltghttpd log

root@L28K:/tmp/log/lighttpd# cat error.log 2016-09-22 21:01:23: (log.c.216) server started

3.Web folder

root@L28K:/www# ls cgi-bin favicon.ico img initfail.html reboot.html css fonts index.html js

root@L28K:/www/js# ls 01-juci.js 50-juci-network-netifd.js 50-juci-ddns.js 50-juci-openwrt-wireless.js 50-juci-dnsmasq-dhcp.js 50-juci-samba.js 50-juci-dropbear.js 50-juci-snmpd.js 50-juci-ethernet.js 50-juci-sysupgrade.js 50-juci-event.js 50-juci-uhttpd.js 50-juci-firewall-fw3.js 50-juci-upnp.js 50-juci-macdb.js 50-juci-usb.js 50-juci-minidlna.js 50-juci-utils.js 50-juci-mod-status.js 60-juci-simple-gui.js 50-juci-mod-system.js 80-juci-theme-openwrt.js

4. router config folder

root@L28K:/etc/config# ls dhcp firewall juci network rpcd wireless dropbear fstab jucid orange system

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249124478, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqidk6ocPFXH0hvpXIFdJZ9sc00OfAks5qs4MSgaJpZM4KEg24 .

Pillar1989 commented 8 years ago

My orangerpcd also installed . and it works fine. root@mylinkit:~# ps PID USER VSZ STAT COMMAND 1 root 1436 S /sbin/procd 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0] 4 root 0 SW [kworker/0:0] 5 root 0 SW< [kworker/0:0H] 6 root 0 SW [kworker/u2:0] 7 root 0 SW< [khelper] 8 root 0 SW [kworker/u2:1] 69 root 0 SW< [writeback] 71 root 0 SW< [bioset] 73 root 0 SW< [kblockd] 76 root 0 SW [kswapd0] 77 root 0 SW [kworker/0:1] 78 root 0 SW [fsnotify_mark] 80 root 0 SW [spi32766] 239 root 0 SW< [deferwq] 272 root 0 SW [kworker/u2:2] 506 root 900 S /sbin/ubusd 539 root 1488 S /bin/ash --login 1127 root 0 SW< [ipv6_addrconf] 1138 root 0 SW< [cifsiod] 1155 root 0 SW< [rpciod] 1178 root 0 SW< [nfsiod] 1228 root 0 SW [kworker/u2:3] 1562 root 1056 S /sbin/logd -S 16 1580 root 1820 S /sbin/rpcd 1615 root 1552 S /sbin/netifd 1643 root 1192 S /usr/sbin/odhcpd 1722 root 0 SW [RtmpCmdQTask] 1723 root 0 SW [RtmpWscTask] 1724 root 0 SW [RtmpMlmeTask] 1733 root 0 SW [kworker/0:2] 1741 http 4108 S /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf 1755 root 30028 S /usr/bin/orangerpcd -p /usr/lib/orange/api/ 1848 nobody 992 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /va 1932 root 1148 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 1961 root 1480 S /usr/sbin/telnetd -F -l /bin/login.sh 1969 root 1736 S /usr/sbin/dbus-daemon --system 1996 root 3112 S /usr/sbin/smbd -F 1997 root 3180 S /usr/sbin/nmbd -F 2004 nobody 2172 S avahi-daemon: running [mylinkit.local] 2011 root 1012 S /sbin/mountd -f 2022 root 0 SWN [jffs2_gcd_mtd6] 2043 root 1484 S /usr/sbin/ntpd -n -S /usr/sbin/ntpd-hotplug -p 0.ope 2046 root 1484 R ps

I have same problem. image

mkschreder commented 8 years ago

Check in browser console what http error code it prints when connecting to websocket. If it is 404 or 503 then you have openwrt lighttpd and need to make sure you are building with the one from juci repo.

On 23 Sep 2016 12:53, "Baozhu Zuo" notifications@github.com wrote:

My orangerpcd also installed . and it works fine. root@mylinkit:~# ps PID USER VSZ STAT COMMAND 1 root 1436 S /sbin/procd 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0] 4 root 0 SW [kworker/0:0] 5 root 0 SW< [kworker/0:0H] 6 root 0 SW [kworker/u2:0] 7 root 0 SW< [khelper] 8 root 0 SW [kworker/u2:1] 69 root 0 SW< [writeback] 71 root 0 SW< [bioset] 73 root 0 SW< [kblockd] 76 root 0 SW [kswapd0] 77 root 0 SW [kworker/0:1] 78 root 0 SW [fsnotify_mark] 80 root 0 SW [spi32766] 239 root 0 SW< [deferwq] 272 root 0 SW [kworker/u2:2] 506 root 900 S /sbin/ubusd 539 root 1488 S /bin/ash --login 1127 root 0 SW< [ipv6_addrconf] 1138 root 0 SW< [cifsiod] 1155 root 0 SW< [rpciod] 1178 root 0 SW< [nfsiod] 1228 root 0 SW [kworker/u2:3] 1562 root 1056 S /sbin/logd -S 16 1580 root 1820 S /sbin/rpcd 1615 root 1552 S /sbin/netifd 1643 root 1192 S /usr/sbin/odhcpd 1722 root 0 SW [RtmpCmdQTask] 1723 root 0 SW [RtmpWscTask] 1724 root 0 SW [RtmpMlmeTask] 1733 root 0 SW [kworker/0:2] 1741 http 4108 S /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf 1755 root 30028 S /usr/bin/orangerpcd -p /usr/lib/orange/api/ 1848 nobody 992 S /usr/sbin/dnsmasq -C /var/etc/dnsmasq.conf -k -x /va 1932 root 1148 S /usr/sbin/dropbear -F -P /var/run/dropbear.1.pid -p 1961 root 1480 S /usr/sbin/telnetd -F -l /bin/login.sh 1969 root 1736 S /usr/sbin/dbus-daemon --system 1996 root 3112 S /usr/sbin/smbd -F 1997 root 3180 S /usr/sbin/nmbd -F 2004 nobody 2172 S avahi-daemon: running [mylinkit.local] 2011 root 1012 S /sbin/mountd -f 2022 root 0 SWN [jffs2_gcd_mtd6] 2043 root 1484 S /usr/sbin/ntpd -n -S /usr/sbin/ntpd-hotplug -p 0.ope 2046 root 1484 R ps

I have same problem. [image: image] https://cloud.githubusercontent.com/assets/4081906/18783530/c74910ca-81be-11e6-9724-73df8dce73db.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249161379, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiXXUNPk4W1jxqF7E7ABrVUrkGvBgks5qs6-tgaJpZM4KEg24 .

ianchi commented 8 years ago

Hi @mkschreder !

I have the same problem "You do not have an RPC connection to the router!" I console a get a 400 Bad Request:

GET http://192.168.20.100/websocket/ [HTTP/1.1 400 Bad Request 8ms]

I've followed all the new instructions to install the feed in owrt and I'm pretty sure that I have the Juci modified version of lighttpd.

This is what I see in error.log

2016-09-25 06:14:54: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/ 
2016-09-25 06:14:54: (mod_websocket_handshake.c.195) Origin header does not exist 
2016-09-25 06:14:54: (mod_websocket.c.854) disconnected from client ( fd = 6 ) 

And from the browser console the request has an 'origin' header, but with lower case 'o'. Could that be the problem?

REQUEST HEADERS:
-----------
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.5
Cache-Control: no-cache
Connection: keep-alive, Upgrade
Host: 192.168.20.100
Pragma: no-cache
Sec-WebSocket-Extensions: permessage-deflate
Sec-WebSocket-Key: /6Mm3s+pe3vtZOcOV2sRiw==
Sec-WebSocket-Version: 13
Upgrade: websocket
User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0
origin: http://192.168.20.100
mkschreder commented 8 years ago

It could actually be the origin header. You can test the websocket ysing nodejs cli client that comes in the orangerpcd repo. Make sure you extract the node_modules.tar.gz in the same folder though because that explicitly adds the origin header to all requests. This

On 25 Sep 2016 08:54, "Adrián Panella" notifications@github.com wrote:

Hi @mkschreder https://github.com/mkschreder !

I have the same problem "You do not have an RPC connection to the router!" I console a get a 400 Bad Request:

GET http://192.168.20.100/websocket/ [HTTP/1.1 400 Bad Request 8ms]

I've followed all the new instructions to install the feed in owrt and I'm pretty sure that I have the Juci modified version of lighttpd.

This is what I see in error.log

2016-09-25 06:14:54: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/ 2016-09-25 06:14:54: (mod_websocket_handshake.c.195) Origin header does not exist 2016-09-25 06:14:54: (mod_websocket.c.854) disconnected from client ( fd = 6 )

And from the browser console the request has an 'origin' header, but with lower case 'o'. Could that be the problem?

REQUEST HEADERS:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5 Cache-Control: no-cache Connection: keep-alive, Upgrade Host: 192.168.20.100 Pragma: no-cache Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Key: /6Mm3s+pe3vtZOcOV2sRiw== Sec-WebSocket-Version: 13 Upgrade: websocket User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 origin: http://192.168.20.100

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249406269, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiUIYExsjRZHJDOP71l7tuvii5P8qks5qthqqgaJpZM4KEg24 .

mkschreder commented 8 years ago

It could actually be the origin header. You can test the websocket ysing nodejs cli client that comes in the orangerpcd repo. Make sure you extract the node_modules.tar.gz in the same folder though because that explicitly adds the origin header to all requests. This

On 25 Sep 2016 08:54, "Adrián Panella" notifications@github.com wrote:

Hi @mkschreder https://github.com/mkschreder !

I have the same problem "You do not have an RPC connection to the router!" I console a get a 400 Bad Request:

GET http://192.168.20.100/websocket/ [HTTP/1.1 400 Bad Request 8ms]

I've followed all the new instructions to install the feed in owrt and I'm pretty sure that I have the Juci modified version of lighttpd.

This is what I see in error.log

2016-09-25 06:14:54: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/ 2016-09-25 06:14:54: (mod_websocket_handshake.c.195) Origin header does not exist 2016-09-25 06:14:54: (mod_websocket.c.854) disconnected from client ( fd = 6 )

And from the browser console the request has an 'origin' header, but with lower case 'o'. Could that be the problem?

REQUEST HEADERS:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5 Cache-Control: no-cache Connection: keep-alive, Upgrade Host: 192.168.20.100 Pragma: no-cache Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Key: /6Mm3s+pe3vtZOcOV2sRiw== Sec-WebSocket-Version: 13 Upgrade: websocket User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 origin: http://192.168.20.100

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249406269, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiUIYExsjRZHJDOP71l7tuvii5P8qks5qthqqgaJpZM4KEg24 .

mkschreder commented 8 years ago

.. I accidentally pressed the send button :D

Anyway. Now that you mention this I can imagine that this could actually be a problem on some browsers and should probably be patched in lighttpd to not even expect the origin header (it currently throws an error if it doesn't get it).. I note this for future todo.

On 25 Sep 2016 09:04, wrote:

It could actually be the origin header. You can test the websocket ysing nodejs cli client that comes in the orangerpcd repo. Make sure you extract the node_modules.tar.gz in the same folder though because that explicitly adds the origin header to all requests. This

On 25 Sep 2016 08:54, "Adrián Panella" notifications@github.com wrote:

Hi @mkschreder https://github.com/mkschreder !

I have the same problem "You do not have an RPC connection to the router!" I console a get a 400 Bad Request:

GET http://192.168.20.100/websocket/ [HTTP/1.1 400 Bad Request 8ms]

I've followed all the new instructions to install the feed in owrt and I'm pretty sure that I have the Juci modified version of lighttpd.

This is what I see in error.log

2016-09-25 06:14:54: (mod_websocket.c.340) /websocket/ is match WebSocket extension: /websocket/ 2016-09-25 06:14:54: (mod_websocket_handshake.c.195) Origin header does not exist 2016-09-25 06:14:54: (mod_websocket.c.854) disconnected from client ( fd = 6 )

And from the browser console the request has an 'origin' header, but with lower case 'o'. Could that be the problem?

REQUEST HEADERS:

Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5 Cache-Control: no-cache Connection: keep-alive, Upgrade Host: 192.168.20.100 Pragma: no-cache Sec-WebSocket-Extensions: permessage-deflate Sec-WebSocket-Key: /6Mm3s+pe3vtZOcOV2sRiw== Sec-WebSocket-Version: 13 Upgrade: websocket User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:48.0) Gecko/20100101 Firefox/48.0 origin: http://192.168.20.100

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249406269, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiUIYExsjRZHJDOP71l7tuvii5P8qks5qthqqgaJpZM4KEg24 .

ianchi commented 8 years ago

Update, it seems that the issue is with Firefox With Chrome the heather is 'Origin' (with capital) and the log doesn't show that problem

Now on the web page I get Please enter correct username and password!

even though it is the correct data

And on the UML image console I get: [ 5286.070000] orangerpcd[4029]: segfault at 4005d468 ip 000000004047f04d sp 000000004005d430 error 7 in libblobpack.so.0.0.0[4047a000+208000]

I got the error many times and finally the orangerpcd instance was killed

ianchi commented 8 years ago

@mkschreder I get a segfault each time the webpage try to make a rpc call. The websocket is initialized but then it drops. So I'm never able to login

RPC init
connecting to rpc server at (ws://192.168.20.100/websocket/)
RPC connection established!
connection closed!
request timed out! (list)
could not initialize rpc interface
mkschreder commented 8 years ago

What arch is it? Could it be the same as this one: https://github.com/mkschreder/orangerpcd/issues/2

On 25 Sep 2016 09:07, "Adrián Panella" notifications@github.com wrote:

Update, it seems that the issue is with Firefox With Chrome the heather is 'Origin' (with capital) and the log doesn't show that problem

Now on the web page I get Please enter correct username and password!

even though it is the correct data

And on the UML image console I get: [ 5286.070000] orangerpcd[4029]: segfault at 4005d468 ip 000000004047f04d sp 000000004005d430 error 7 in libblobpack.so.0.0.0[4047a000+208000]

I got the error many times and finally the orangerpcd instance was killed

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249406666, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiS3diokT3PSoiba5eGIpYmH-yeIiks5qth2ygaJpZM4KEg24 .

ianchi commented 8 years ago

It is x86_64 running as a UML

ianchi commented 8 years ago

Perhaps it is the same problem but now in libblobpack.

This is the console output with orangerpc running with debug level, and after one attempt to loguein:

Orange RPCD v0.1.0
Lua/JSONRPC server
Copyright (c) 2016 Martin Schröder <mkschreder.uk@gmail.com>
WARNING: no interface name supplied so will be listening on ALL interfaces. If this is not what you want then supply an ip address on which to listen!
starting server on 'lo:5303'
[1474790272:4922] NOTICE: Initial logging level 7
[1474790272:4923] NOTICE: Libwebsockets version: 1.6.0 e849d36
[1474790272:4923] NOTICE: IPV6 not compiled in
[1474790272:4923] NOTICE: libev support not compiled in
[1474790272:4935] NOTICE:  mem: platform fd map: 32768 bytes
[1474790272:4936] NOTICE:  mem: per-conn:          312 bytes + protocol rx buf
[1474790272:4948] NOTICE:  canonical_hostname = lede
[1474790272:4952] NOTICE:  Listening on port 5303
loading users from config /etc/config/orange
added user 'admin'
loading passwords from /etc/orange/shadow
updated existing user admin
loading plugin /file of /usr/lib/orange/api//file.lua at base /usr/lib/orange/api/
loading plugin /juci/ddns of /usr/lib/orange/api//juci/ddns.lua at base /usr/lib/orange/api/
loading plugin /juci/dhcp of /usr/lib/orange/api//juci/dhcp.lua at base /usr/lib/orange/api/
loading plugin /juci/dropbear of /usr/lib/orange/api//juci/dropbear.lua at base /usr/lib/orange/api/
loading plugin /juci/ethernet of /usr/lib/orange/api//juci/ethernet.lua at base /usr/lib/orange/api/
loading plugin /juci/ethernet.modems of /usr/lib/orange/api//juci/ethernet.modems.lua at base /usr/lib/orange/api/
loading plugin /juci/firewall.dmz of /usr/lib/orange/api//juci/firewall.dmz.lua at base /usr/lib/orange/api/
loading plugin /juci/macdb of /usr/lib/orange/api//juci/macdb.lua at base /usr/lib/orange/api/
loading plugin /juci/minidlna of /usr/lib/orange/api//juci/minidlna.lua at base /usr/lib/orange/api/
loading plugin /juci/network of /usr/lib/orange/api//juci/network.lua at base /usr/lib/orange/api/
loading plugin /juci/network.status of /usr/lib/orange/api//juci/network.status.lua at base /usr/lib/orange/api/
loading plugin /juci/samba of /usr/lib/orange/api//juci/samba.lua at base /usr/lib/orange/api/
loading plugin /juci/swconfig of /usr/lib/orange/api//juci/swconfig.lua at base /usr/lib/orange/api/
loading plugin /juci/system.conf of /usr/lib/orange/api//juci/system.conf.lua at base /usr/lib/orange/api/
loading plugin /juci/system.logs of /usr/lib/orange/api//juci/system.logs.lua at base /usr/lib/orange/api/
loading plugin /juci/system of /usr/lib/orange/api//juci/system.lua at base /usr/lib/orange/api/
loading plugin /juci/system.process of /usr/lib/orange/api//juci/system.process.lua at base /usr/lib/orange/api/
loading plugin /juci/system.service of /usr/lib/orange/api//juci/system.service.lua at base /usr/lib/orange/api/
loading plugin /juci/system.time of /usr/lib/orange/api//juci/system.time.lua at base /usr/lib/orange/api/
loading plugin /juci/system.upgrade of /usr/lib/orange/api//juci/system.upgrade.lua at base /usr/lib/orange/api/
loading plugin /juci/system.user of /usr/lib/orange/api//juci/system.user.lua at base /usr/lib/orange/api/
loading plugin /juci/ui of /usr/lib/orange/api//juci/ui.lua at base /usr/lib/orange/api/
loading plugin /juci/upnpd of /usr/lib/orange/api//juci/upnpd.lua at base /usr/lib/orange/api/
loading plugin /juci/usb of /usr/lib/orange/api//juci/usb.lua at base /usr/lib/orange/api/
loading plugin /juci/wireless of /usr/lib/orange/api//juci/wireless.lua at base /usr/lib/orange/api/
loading plugin /network.interface of /usr/lib/orange/api//network.interface.lua at base /usr/lib/orange/api/
loading plugin /network.wireless of /usr/lib/orange/api//network.wireless.lua at base /usr/lib/orange/api/
loading plugin /session of /usr/lib/orange/api//session.lua at base /usr/lib/orange/api/
loading plugin /system of /usr/lib/orange/api//system.lua at base /usr/lib/orange/api/
loading plugin /test of /usr/lib/orange/api//test.lua at base /usr/lib/orange/api/
loading plugin /uci of /usr/lib/orange/api//uci.lua at base /usr/lib/orange/api/
connection established! localhost 127.0.0.1 8 2a730979
received fragment of 91 bytes
[ 2898.390000] orangerpcd[4087]: segfault at 4005d468 ip 000000004047f04d sp 000000004005d430 error 7 in libblobpack.so.0.0.0[4047a000+208000]
Segmentation fault
mkschreder commented 8 years ago

Can you build with debug info and use gdb to get the code libe where this happens?

On 25 Sep 2016 10:01, "Adrián Panella" notifications@github.com wrote:

Perhaps it is the same problem but now in libblobpack.

This is the console output with orangerpc running with debug level, and after one attempt to loguein:

Orange RPCD v0.1.0 Lua/JSONRPC server Copyright (c) 2016 Martin Schröder mkschreder.uk@gmail.com WARNING: no interface name supplied so will be listening on ALL interfaces. If this is not what you want then supply an ip address on which to listen! starting server on 'lo:5303' [1474790272:4922] NOTICE: Initial logging level 7 [1474790272:4923] NOTICE: Libwebsockets version: 1.6.0 e849d36 [1474790272:4923] NOTICE: IPV6 not compiled in [1474790272:4923] NOTICE: libev support not compiled in [1474790272:4935] NOTICE: mem: platform fd map: 32768 bytes [1474790272:4936] NOTICE: mem: per-conn: 312 bytes + protocol rx buf [1474790272:4948] NOTICE: canonical_hostname = lede [1474790272:4952] NOTICE: Listening on port 5303 loading users from config /etc/config/orange added user 'admin' loading passwords from /etc/orange/shadow updated existing user admin loading plugin /file of /usr/lib/orange/api//file.lua at base /usr/lib/orange/api/ loading plugin /juci/ddns of /usr/lib/orange/api//juci/ddns.lua at base /usr/lib/orange/api/ loading plugin /juci/dhcp of /usr/lib/orange/api//juci/dhcp.lua at base /usr/lib/orange/api/ loading plugin /juci/dropbear of /usr/lib/orange/api//juci/dropbear.lua at base /usr/lib/orange/api/ loading plugin /juci/ethernet of /usr/lib/orange/api//juci/ethernet.lua at base /usr/lib/orange/api/ loading plugin /juci/ethernet.modems of /usr/lib/orange/api//juci/ethernet.modems.lua at base /usr/lib/orange/api/ loading plugin /juci/firewall.dmz of /usr/lib/orange/api//juci/firewall.dmz.lua at base /usr/lib/orange/api/ loading plugin /juci/macdb of /usr/lib/orange/api//juci/macdb.lua at base /usr/lib/orange/api/ loading plugin /juci/minidlna of /usr/lib/orange/api//juci/minidlna.lua at base /usr/lib/orange/api/ loading plugin /juci/network of /usr/lib/orange/api//juci/network.lua at base /usr/lib/orange/api/ loading plugin /juci/network.status of /usr/lib/orange/api//juci/network.status.lua at base /usr/lib/orange/api/ loading plugin /juci/samba of /usr/lib/orange/api//juci/samba.lua at base /usr/lib/orange/api/ loading plugin /juci/swconfig of /usr/lib/orange/api//juci/swconfig.lua at base /usr/lib/orange/api/ loading plugin /juci/system.conf of /usr/lib/orange/api//juci/system.conf.lua at base /usr/lib/orange/api/ loading plugin /juci/system.logs of /usr/lib/orange/api//juci/system.logs.lua at base /usr/lib/orange/api/ loading plugin /juci/system of /usr/lib/orange/api//juci/system.lua at base /usr/lib/orange/api/ loading plugin /juci/system.process of /usr/lib/orange/api//juci/system.process.lua at base /usr/lib/orange/api/ loading plugin /juci/system.service of /usr/lib/orange/api//juci/system.service.lua at base /usr/lib/orange/api/ loading plugin /juci/system.time of /usr/lib/orange/api//juci/system.time.lua at base /usr/lib/orange/api/ loading plugin /juci/system.upgrade of /usr/lib/orange/api//juci/system.upgrade.lua at base /usr/lib/orange/api/ loading plugin /juci/system.user of /usr/lib/orange/api//juci/system.user.lua at base /usr/lib/orange/api/ loading plugin /juci/ui of /usr/lib/orange/api//juci/ui.lua at base /usr/lib/orange/api/ loading plugin /juci/upnpd of /usr/lib/orange/api//juci/upnpd.lua at base /usr/lib/orange/api/ loading plugin /juci/usb of /usr/lib/orange/api//juci/usb.lua at base /usr/lib/orange/api/ loading plugin /juci/wireless of /usr/lib/orange/api//juci/wireless.lua at base /usr/lib/orange/api/ loading plugin /network.interface of /usr/lib/orange/api//network.interface.lua at base /usr/lib/orange/api/ loading plugin /network.wireless of /usr/lib/orange/api//network.wireless.lua at base /usr/lib/orange/api/ loading plugin /session of /usr/lib/orange/api//session.lua at base /usr/lib/orange/api/ loading plugin /system of /usr/lib/orange/api//system.lua at base /usr/lib/orange/api/ loading plugin /test of /usr/lib/orange/api//test.lua at base /usr/lib/orange/api/ loading plugin /uci of /usr/lib/orange/api//uci.lua at base /usr/lib/orange/api/ connection established! localhost 127.0.0.1 8 2a730979 received fragment of 91 bytes [ 2898.390000] orangerpcd[4087]: segfault at 4005d468 ip 000000004047f04d sp 000000004005d430 error 7 in libblobpack.so.0.0.0[4047a000+208000] Segmentation fault

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249408615, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqiQBDr6SXaJBZ1iFRnfUXwvpbP1gzks5qtipLgaJpZM4KEg24 .

ianchi commented 8 years ago

I'll do as soon as I have some time.

By the way, I'm also using musl, so it seems the same problem commented by @mk-f I've just reaplied his patch, and now Juci is up and running

mkschreder commented 8 years ago

Ok. Great.

On 25 Sep 2016 10:23, "Adrián Panella" notifications@github.com wrote:

I'll do as soon as I have some time.

By the way, I'm also using musl, so it seems the same problem commented by @mk-f https://github.com/mk-f I've just reaplied his patch, and now Juci is up and running

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mkschreder/juci/issues/62#issuecomment-249409430, or mute the thread https://github.com/notifications/unsubscribe-auth/AERqic8f_M4O0KtiBIgGm8rV6ke-gyPjks5qti-TgaJpZM4KEg24 .

JangAlla commented 8 years ago

Answer is really appreciated. Note We'll get to try again to see results.

rojoSeliro commented 6 years ago

I'll do as soon as I have some time.

By the way, I'm also using musl, so it seems the same problem commented by @mk-f I've just reaplied his patch, and now Juci is up and running

Hi ianchi can you redirect me to the patch of @mk-f for this juci up and running?