Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

does not auto update without start hapt on openwrt #3

Closed
PaddyPat opened this issue Jan 21, 2024 · 4 comments
Closed

does not auto update without start hapt on openwrt #3

PaddyPat opened this issue Jan 21, 2024 · 4 comments

Comments

@PaddyPat
Copy link

PaddyPat commented Jan 21, 2024

hi,
running latest openwrt,
my config file:

config hapt 'global'
        option host                     'http://ipaddress:8123'
        option token                    'token'
        option consider_home_connect    '86400'
        option consider_home_disconnect '60'
        option device_id_prefix         ''
#       list   wifi_interfaces          'wlan0'
#       list   wifi_interfaces          'wlan1'
#       list   track_mac_address        '00:11:22:33:44:55'
#       list   track_mac_address        '66:77:88:99:aa:bb'

in logread I get

Command failed: Not found
Traceback (most recent call last):
File "/usr/bin/hapt", line 278, in
File "/usr/bin/hapt", line 260, in oneshot
File "/usr/bin/hapt", line 76, in get_connected_clients
File "/usr/bin/hapt", line 62, in ubus_call
ValueError: syntax error in JSON

If a device disconnect, no hapt execution is execute (see it in logread)
status will be fine submitted, if i run hapt via cli

thanks for your help and your tool
br

@oxan
Copy link
Owner

oxan commented Jan 21, 2024

I've also seen this error once, but have never been able to reproduce it. Can you reproduce it?

If so, it'd be useful if you could replace line 62 in /usr/bin/hapt (return json.loads(subprocess(command))) with this (make sure to indent with tabs) and give me the log output:

	print("Executing '%s'" % command)
	output = subprocess(command)
	print("Output '%s'" % output)
	return json.loads(output)

@PaddyPat
Copy link
Author

@oxan
Copy link
Owner

oxan commented Jan 24, 2024

Ah, I see. The problem is that hapt thinks there's an interface named global due to the /var/run/hostapd/global control interface. I haven't encountered this myself because I explicitly list the interfaces to be monitored in the config, and I probably hit it that one time on an upgrade, before I put my config in place.

@oxan
Copy link
Owner

oxan commented Jan 24, 2024

Should be fixed in e20b5ff and the new v0.4 release. Thanks for your assistance!

@oxan oxan closed this as completed Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants