helium / gateway-config

The Helium configuration application. Enables configuring the Helium Hotspot over Bluetooth
Apache License 2.0
38 stars 25 forks source link

Not able to see gateway on nrF Connect (bluetooth) #91

Closed pradeeptewary closed 2 years ago

pradeeptewary commented 2 years ago

I am able to compile and boot gateway_config, but it is NOT showing in helium or nrF app during bluetooth scan. I have attached the console, error and crash logs (and erl_crash.dump file) for the reference. console.log crash.log error.log erl_crash.txt

Following are the logs of the gateway while running;

$ sudo ./rebar3 shell

_===> Verifying dependencies... ===> Plugin rebar3_eqc does not export init/1. It will not be used. ===> Analyzing applications... ===> Compiling gateway_config Erlang/OTP 22 [erts-10.7.2.1] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] Eshell V10.7.2.1 (abort with ^G) 1> ===> Booted syntax_tools ===> Booted compiler ===> Booted goldrush ===> Booted lager ===> Booted erlang_ale ===> Booted h3 ===> Booted ebus ===> Booted gatt ===> Booted connman ===> Booted cuttlefish ===> Booted clique ===> Booted grpc_client ===> Booted cowlib ===> Booted http2_client ===> Booted gatewayconfig

While running in other mode, described on repo, following output is given my app:

_pi@raspberrypi:~/gateway-config/_build/prod/rel/gateway_config $ bin/gatewayconfig foreground _Exec: /snap/erlang/89/usr/bin/../lib/erlang/erts-10.7.2.1/bin/erlexec -noinput +Bd -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/gateway_config -mode embedded -boot_var SYSTEM_LIB_DIR /snap/erlang/89/usr/bin/../lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -args_file /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/vm.args -- foreground Root: /home/pi/gateway-config/_build/prod/rel/gateway_config /home/pi/gateway-config/_build/prod/rel/gateway_config {"Kernel pid terminated",application_controller,"{application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config_worker,start_link,1,[{file,\"/home/pi/gateway-config/src/gateway_config_worker.erl\"},{line,53}]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,379}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,365}]},{supervisor,'-start_children/2-fun-0-',3,[{file,\"supervisor.erl\"},{line,349}]},{supervisor,children_map,4,[{file,\"supervisor.erl\"},{line,1157}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,315}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]}]}}}},{gateway_config_app,start,[normal,[]]}}}"} Kernel pid terminated (application_controller) ({application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config

Crash dump is being written to: erlcrash.dump...done

Also, while running the following dbus-send command, we get the following errror: $ dbus-send --system --print-reply --dest=com.helium.Miner / com.helium.Miner.P2PStatus Error org.freedesktop.DBus.Error.ServiceUnknown: The name com.helium.Miner was not provided by any .service files

Please help?

madninja commented 2 years ago

Looks like you maybe missed a step in https://github.com/helium/gateway-config#install where you need to copy a dbus config file to the right location and restart/reload dbus to have it pick it up.

The no_access is also a likely indicator that the user you are running gateway-config as does not have permissions to access the dbus socket. Make sure the user is in the bluetooth group (or whatever the right group is on your distro)

pradeeptewary commented 2 years ago
  1. Dear @Marc I had followed the steps of the repo and the conf file exists in the said location (can be seen from the following ls) pi@raspberrypi:/etc/dbus-1/system.d $ ls _avahi-dbus.conf com.helium.Config.conf com.redhat.NewPrinterNotification.conf dundee.conf org.freedesktop.DisplayManager.conf org.opensuse.CupsPkHelper.Mechanism.conf wpasupplicant.conf bluetooth.conf com.hp.hplip.conf com.redhat.PrinterDriversInstaller.conf ofono.conf org.freedesktop.PackageKit.conf pulseaudio-system.conf

  2. Also for the no_access error, i couldn't understand completely but I can see the bluetooth group in the groups list. pi@raspberrypi:/etc/dbus-1/system.d $ grep root /etc/group root:x:0: bluetooth:x:112:root,pi lpadmin:x:117:root,pi

$ groups pi adm dialout cdrom sudo audio video plugdev games users input render netdev bluetooth lpadmin docker gpio i2c spi

Also while running the following command from the build release, I get the following error. $ bin/gateway_config advertise on

Node 'gateway config@127.0.0.1' not responding to pings.

Please help?

pradeeptewary commented 2 years ago

I tried $ rebar3 release and while executing _$ bin/gatewayconfig start or foreground, it doesn't show any error and we are able to see the ping response (pong) and pid. However, It is not visible in helium app. When I run the _$ gateway_config:advertiseenable(true) from the erl console, the pi shows in the helium app. And while pairing the pi, I get the Error, characteristics (UUID_GATEWAY_GATT_SERVICE and UUID_GATEWAY_GATT_CHAR_WIFI_SSID) read failed for device. Also, when i check the console logs, i see following warnings and errors:

2022-04-23 16:25:08.682 [error] <0.641.0> CRASH REPORT Process gateway_config_led with 1 neighbours exited with reason: {{undef,[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,...},...]},...]},...} in gen_server:call/2 line 215
2022-04-23 16:25:08.690 [error] <0.578.0> Supervisor gateway_config_sup had child gateway_config_led started with gateway_config_led:start_link(<0.554.0>) at <0.641.0> exit with reason {{undef,[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,...},...]},...]},...} in context shutdown_error
2022-04-23 16:25:08.691 [warning] <0.650.0>@gateway_config_worker:init_button:76 No GPIO device tree found, running in stub mode
2022-04-23 16:25:08.694 [warning] <0.653.0>@gateway_config_led:init:77 No i2c device found, running in stub mode
2022-04-23 16:25:08.698 [info] <0.653.0>@gateway_config_led:led_set_color:239 Would have set LED: {255,255,0}
2022-04-23 16:25:08.836 [info] <0.659.0>@gateway_gatt_char_wifi_ssid:maybe_unregister_state_notify:144 WiFi still disconnected
2022-04-23 16:25:08.838 [warning] <0.659.0>@gateway_gatt_char_wifi_ssid:maybe_register_state_notify:136 early WiFi online event

Please help?

madninja commented 2 years ago

I tried $ rebar3 release and while executing _$ bin/gatewayconfig start or foreground, it doesn't show any error and we are able to see the ping response (pong) and pid. However, It is not visible in helium app. When I run the _$ gateway_config:advertiseenable(true) from the erl console, the pi shows in the helium app. And while pairing the pi, I get the Error, characteristics (UUID_GATEWAY_GATT_SERVICE and UUID_GATEWAY_GATT_CHAR_WIFI_SSID) read failed for device. Also, when i check the console logs, i see following warnings and errors:

2022-04-23 16:25:08.682 [error] <0.641.0> CRASH REPORT Process gateway_config_led with 1 neighbours exited with reason: {{undef,[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,...},...]},...]},...} in gen_server:call/2 line 215
2022-04-23 16:25:08.690 [error] <0.578.0> Supervisor gateway_config_sup had child gateway_config_led started with gateway_config_led:start_link(<0.554.0>) at <0.641.0> exit with reason {{undef,[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,...},...]},...]},...} in context shutdown_error
2022-04-23 16:25:08.691 [warning] <0.650.0>@gateway_config_worker:init_button:76 No GPIO device tree found, running in stub mode
2022-04-23 16:25:08.694 [warning] <0.653.0>@gateway_config_led:init:77 No i2c device found, running in stub mode
2022-04-23 16:25:08.698 [info] <0.653.0>@gateway_config_led:led_set_color:239 Would have set LED: {255,255,0}
2022-04-23 16:25:08.836 [info] <0.659.0>@gateway_gatt_char_wifi_ssid:maybe_unregister_state_notify:144 WiFi still disconnected
2022-04-23 16:25:08.838 [warning] <0.659.0>@gateway_gatt_char_wifi_ssid:maybe_register_state_notify:136 early WiFi online event

Please help?

Good, so you figured out (as the readme says) that you need to have gateway_config running to be able to use it.

pradeeptewary commented 2 years ago

This is my crash log

2022-04-23 15:48:38 =ERROR REPORT====
** Generic server gateway_config_miner terminating 
** Last message in was status
** When Server state == {state,undefined}
** Reason for termination ==
** {'module could not be loaded',[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,661}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,690}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
** Client gateway_config_led stacktrace
** [{gen,do_call,4,[{file,"gen.erl"},{line,167}]},{gen_server,call,2,[{file,"gen_server.erl"},{line,211}]},{gateway_config,diagnostics,0,[{file,"/home/pi/gateway-config/src/gateway_config.erl"},{line,294}]},{gateway_config_led,handle_info,2,[{file,"/home/pi/gateway-config/src/gateway_config_led.erl"},{line,129}]},{gen_server,try_dispatch,4,[{file,"gen_server.erl"},{line,637}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,711}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]
2022-04-23 15:48:38 =CRASH REPORT====
  crasher:
    initial call: gateway_config_miner:init/1
    pid: <0.578.0>
    registered_name: gateway_config_miner
    exception error: {undef,[{grpc_lib,keytake,[transport_options,[],[]],[]},{grpc_client_connection,process_options,2,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,153}]},{grpc_client_connection,new,4,[{file,"/home/pi/gateway-config/_build/default/lib/grpc_client/src/grpc_client_connection.erl"},{line,57}]},{gateway_config_miner,handle_call,3,[{file,"/home/pi/gateway-config/src/gateway_config_miner.erl"},{line,52}]},{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,661}]},{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,690}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
    ancestors: [gateway_config_sup,<0.574.0>]
    message_queue_len: 0
    messages: []
    links: [<0.575.0>]
    dictionary: []
    trap_exit: false
    status: running
    heap_size: 1598
    stack_size: 27
    reductions: 644
  neighbours:
  1. I am getting {undef,[{grpc_lib,keytake error
  2. How do I know that my build is partial ?
  3. I am still not able to run my application using $ bin/gateway_config foreground This is the error that I face
Exec: /snap/erlang/89/usr/bin/../lib/erlang/erts-10.7.2.1/bin/erlexec -noinput +Bd -boot /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/gateway_config -mode embedded -boot_var SYSTEM_LIB_DIR /snap/erlang/89/usr/bin/../lib/erlang/lib -config /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/sys.config -args_file /home/pi/gateway-config/_build/prod/rel/gateway_config/releases/0.1.0/vm.args -- foreground
Root: /home/pi/gateway-config/_build/prod/rel/gateway_config
/home/pi/gateway-config/_build/prod/rel/gateway_config
{"Kernel pid terminated",application_controller,"{application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config_worker,start_link,1,[{file,\"/home/pi/gateway-config/src/gateway_config_worker.erl\"},{line,53}]},{supervisor,do_start_child_i,3,[{file,\"supervisor.erl\"},{line,379}]},{supervisor,do_start_child,2,[{file,\"supervisor.erl\"},{line,365}]},{supervisor,'-start_children/2-fun-0-',3,[{file,\"supervisor.erl\"},{line,349}]},{supervisor,children_map,4,[{file,\"supervisor.erl\"},{line,1157}]},{supervisor,init_children,2,[{file,\"supervisor.erl\"},{line,315}]},{gen_server,init_it,2,[{file,\"gen_server.erl\"},{line,374}]},{gen_server,init_it,6,[{file,\"gen_server.erl\"},{line,342}]}]}}}},{gateway_config_app,start,[normal,[]]}}}"}
Kernel pid terminated (application_controller) ({application_start_failure,gateway_config,{{shutdown,{failed_to_start_child,gateway_config_worker,{'EXIT',{{badmatch,{error,no_access}},[{gateway_config
Crash dump is being written to: erl_crash.dump...done.

We are able to run the application through $ sudo ./rebar3 shell. But we are not able to run the application using $ sudo bin/gateway_config foreground then I can't see any output and if I check the status it tells $ bin/gateway_config status Node not running!.