OpenWrt Forum Archive

Topic: LuCi web gui based on angular js

The content of this topic has been archived between 18 Apr 2018 and 22 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi, mkschreder

      When I compile JUCI within OpenWRT, make report a error.
openwrt version is : git://git.openwrt.org/14.07/openwrt.git

chmod +x bin/usr/bin/*
chmod: cannot access 'bin/usr/bin/*': No such file or directory
make[4]: [plugins/juci-usb] Error 1 (ignored)
chmod +x bin/usr/lib/rpcd/cgi/*
UBUS IGMP: 
JUCI ubus enabled: y
./juci-compile 
/usr/bin/env: node: No such file or directory
make[4]: *** [all] Error 127
make[4]: Leaving directory `/home/test/openwrt_juci/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/juci-1.0.33'
make[3]: *** [/home/test/openwrt_juci/openwrt/build_dir/target-i386_i486_uClibc-0.9.33.2/juci-1.0.33/.built] Error 2
make[3]: Leaving directory `/home/test/openwrt_juci/openwrt/feeds/juci/juci'
make[2]: *** [package/feeds/juci/juci/compile] Error 2

ln -sf nodejs node

yhloverx wrote:

ln -sf nodejs node

it works, thank you. but there another question happened , when I set the password for admin, it can't login in. I do password set as the description

By default admin user is used to login but if you don't have password set for admin user you will not be able to login. So then go to the console and set password for admin user or change the user used for logging in by editing /etc/config/rpcd and then do /etc/init.d/rpcd restart.
yhloverx wrote:

build success, but i got login screen with blank page.

You happened to check out the devel code on 08 of Sep when the page was purposefully left blank. ;-) You can try today and the feed should work. After running make, check your build_dir/target../root../www/js and you should see zipped js bundles for all of your selected juci apps there. If not then the makefile is not installing things properly.

The openwrt feed is available here:

src-git juci https://github.com/mkschreder/juci-openwrt-feed.git

(Last edited by mkschreder on 10 Sep 2015, 19:10)

ramguy wrote:
yhloverx wrote:

ln -sf nodejs node

it works, thank you. but there another question happened , when I set the password for admin, it can't login in. I do password set as the description

By default admin user is used to login but if you don't have password set for admin user you will not be able to login. So then go to the console and set password for admin user or change the user used for logging in by editing /etc/config/rpcd and then do /etc/init.d/rpcd restart.

Are you able to login with curl?

curl -d '{ "jsonrpc": "2.0", "id": 1, "method": "call", "params": [ "00000000000000000000000000000000", "session", "login", { "username": "root", "password": "secret"  } ] }'  http://your.router.ip/ubus

@mkschreder:

code from today

$ make package/juci-core/{clean,compile} V=s
make[1]: Entering directory `openwrt/chaos_calmer/ar71xx.generic'
make[2]: Entering directory `openwrt/chaos_calmer/sources/feeds/juci/juci-core'
Makefile:68: *** Download/default is missing the FILE field..  Stop.

@obsy
@mkschreder
i got the same error

yhloverx wrote:

@obsy
@mkschreder
i got the same error

Welcome to devel branch ;-). You can always go back a few commits by changing pkg_source_version in the feed. Or set it to master. In the coming months I will probably set it to use stable releases instead of always fetching latest source code, but then on the other hand you wouldn't get the latest changes by default. Now that I think of it, it would probably be reasonable to have two branches in the feed, one devel and a master. Whatever works best shall pave the way..

I have a major cleanup planned for the whole project and how things are organized and compiled, but that will be after next release in october. But all applications and you may develop right now will still continue to work, just that the build process will work more like the way linux kernel modules are built and installed. I have an idea that it would be cool to allow addon compilation by running make from addon folder and re-using as much of juci make scripts as possible instead of using duplicated makefiles for addons..

For now the easiest way to build extra addons is to create a symlink to them in the plugins folder (or to put them there) and then add the directory to DIRS-y in makefile.

Juci Makefile also includes Makefile.local if it exists and so addons can be included in the build by adding them in Makefile.local. For example to build all of juci modules for testing on local server, a Makefile.local would contain:

DIRS-y += $(wildcard plugins/*) themes/juci-theme-inteno

This will allow building all plugins you have in your plugins folder by using "make debug" and then testing them on the local server by running ./juci-local-server. But you still need a working box to connect to, it is just much quicker to develop this way through the local server.

(Last edited by mkschreder on 14 Sep 2015, 19:51)

hello mkschreder,

I am interested in your great project, and I tried to build under openwrt BB with your lasted juci branch. and after compilation I want to test is on local but always with following error. I am kind new to JS and found no clue by google it.
could you help give some help? thanks.

sudo ./juci-local-server --host 192.168.56.101
............................
Adding bin/www/js/90-juci-samba.tpl.js to index
Adding bin/www/js/90-juci-sysupgrade.tpl.js to index
Adding bin/www/js/90-juci-theme-inteno.tpl.js to index
Adding bin/www/js/90-juci-upnp.tpl.js to index
Adding bin/www/js/90-juci-usb.tpl.js to index
Adding bin/www/js/99-translations.js to index
./juci-update: 95: [: DEBUG: unexpected operator
Recompiled gui, code: 0
JSON_CALL (-> http://192.168.56.101/ubus): {"jsonrpc":"2.0","method":"list","id":1,"params":["00000000000000000000000000000000","*","",{}]}
ERROR: Error: connect ECONNREFUSED: undefined: undefined
JSON_RESP: {"jsonrpc":"2.0","result":[1,"Error: connect ECONNREFUSED"]}
JSON_CALL (-> http://192.168.56.101/ubus): {"jsonrpc":"2.0","method":"list","id":1,"params":["00000000000000000000000000000000","*","",{}]}
ERROR: Error: connect ECONNREFUSED: undefined: undefined
JSON_RESP: {"jsonrpc":"2.0","result":[1,"Error: connect ECONNREFUSED"]}
^Calan@alan:~/Work/openwrt/barrier_breaker/build_dir/target-mips_34kc+dsp_uClibc-0.9.33.2/juci-e70a890b05baf840c4b75898be255f8607d79c10$

br
Allen

hi Schreder,

some more debug infor, i checked the console log in browser and found no error,

Init UBUS ->
01-juci.js:48 registering: session.access, method: undefined
01-juci.js:48 registering: session.login, method: undefined
01-juci.js:48 registering: local.features, method: undefined
01-juci.js:48 registering: local.set_rpc_host, method: undefined
01-juci.js:48 registering: dhcp, method: ipv4leases
01-juci.js:48 registering: dhcp, method: ipv6leases
01-juci.js:48 registering: juci.event, method: poll
01-juci.js:48 registering: juci.events, method: list
01-juci.js:48 registering: juci.network.netdevd, method: autoconf
01-juci.js:48 registering: juci.ui, method: menu
01-juci.js:48 registering: juci.ui, method: acls
01-juci.js:48 registering: log, method: read
01-juci.js:48 registering: log, method: write
.................


but there is is alert window
’Can not establish ubus connection to router. If the router is rebooting then please wait a few minutes and try again‘
every time during visit. i check the juci.js a little and found it request for ubus.juci.system.

in my machine(BB x86-generic), i got following rpc registered. anything still missing? thanks.

root@OpenWrt:~# ubus list
dhcp
juci.event
juci.events
juci.network.netdevd
juci.ui
log
network
network.device
network.interface
network.interface.lan
network.interface.loopback
network.interface.wan6
network.wireless
service
session
sys.dect
system
uci



br
Allen

allenw wrote:

hello mkschreder,

I am interested in your great project, and I tried to build under openwrt BB with your lasted juci branch. and after compilation I want to test is on local but always with following error. I am kind new to JS and found no clue by google it.
could you help give some help? thanks.

sudo ./juci-local-server --host 192.168.56.101
............................
Adding bin/www/js/90-juci-samba.tpl.js to index
Adding bin/www/js/90-juci-sysupgrade.tpl.js to index
Adding bin/www/js/90-juci-theme-inteno.tpl.js to index
Adding bin/www/js/90-juci-upnp.tpl.js to index
Adding bin/www/js/90-juci-usb.tpl.js to index
Adding bin/www/js/99-translations.js to index
./juci-update: 95: [: DEBUG: unexpected operator
Recompiled gui, code: 0
JSON_CALL (-> http://192.168.56.101/ubus): {"jsonrpc":"2.0","method":"list","id":1,"params":["00000000000000000000000000000000","*","",{}]}
ERROR: Error: connect ECONNREFUSED: undefined: undefined
JSON_RESP: {"jsonrpc":"2.0","result":[1,"Error: connect ECONNREFUSED"]}
JSON_CALL (-> http://192.168.56.101/ubus): {"jsonrpc":"2.0","method":"list","id":1,"params":["00000000000000000000000000000000","*","",{}]}
ERROR: Error: connect ECONNREFUSED: undefined: undefined
JSON_RESP: {"jsonrpc":"2.0","result":[1,"Error: connect ECONNREFUSED"]}
^Calan@alan:~/Work/openwrt/barrier_breaker/build_dir/target-mips_34kc+dsp_uClibc-0.9.33.2/juci-e70a890b05baf840c4b75898be255f8607d79c10$

br
Allen

Ok guys, if you are still building from master then I really feel sorry for you :-)

I have now added a profile for bcm53xx sg400 box on top of stock openwrt. It builds from devel juci branch and uses devel branch of the feed. These contain many fixes that make juci work much better now on openwrt. You can check out the profile here: https://github.com/mkschreder/openwrt/b … 10-JUCI.mk and the feed makefile that selects juci packages automatically can be found here: https://github.com/mkschreder/mks-openw … i/Makefile

So suppose you want to build an image for sg400.. here is how you would do it:
git clone https://github.com/mkschreder/openwrt.git
cd openwrt
git checkout juci
./scripts/feeds update juci
./scripts/feeds install -p juci -a
make menuconfig
-- choose target bcm53xx and profile JUCI.
make

You can now probably port this to any other target. :-)

The discussion might have continued from here.