Ethernet Connection Issue


#21

Great, thanks for that.

Here’s the crash (eventually fatal) on boot after Configurator finished.
Using staging branch and cloned 1 hour ago.

I’d try to open a PR but would be too slow and maybe not the simple solution that’s likely possible for this one.

_/ apologize for the log formatting . . how do I put a multi-line block as preformatted text ? _

[ . . . ]

01:29:57.767 [info] Waiting for interface eth0 up.

01:29:57.768 [info] Interface eth0 is up.

01:29:57.779 [debug] Starting ntpd as: ["/usr/sbin/ntpd", "-n", "-d", "-S", "/srv/erlang/lib/nerves_time-0.2.0/priv/ntpd_script", "-p", "3.au.pool.ntp.org", "-p", "2.au.pool.ntp.org"]

01:29:57.780 [debug] Hacking tzdata.

01:29:57.791 [error] Child Farmbot.Target.Network.Manager of Supervisor Farmbot.Target.Network failed to start
** (exit) an exception was raised:
** (CaseClauseError) no case clause matching: "static"
(nerves_network) lib/nerves_network/if_supervisor.ex:80: Nerves.Network.IFSupervisor.manager/2
(nerves_network) lib/nerves_network/if_supervisor.ex:28: Nerves.Network.IFSupervisor.setup/2
(farmbot) platform/target/network/manager.ex:56: Farmbot.Target.Network.Manager.init/1
(stdlib) gen_server.erl:374: :gen_server.init_it/2
(stdlib) gen_server.erl:342: :gen_server.init_it/6
(stdlib) proc_lib.erl:249: :proc_lib.init_p_do_apply/3

Start Call: Farmbot.Target.Network.Manager.start_link("eth0", [domain: "fb2", name_servers: ["10.0.1.1"], ipv4_address_method: "static", ipv4_address: "10.0.1.120", ipv4_gateway: "10.0.1.1", ipv4_subnet_mask: "255.255.255.0"])
Restart: :transient
Shutdown: 5000
Type: :worker

01:29:57.797 [error] Child Farmbot.Target.Network of Supervisor Farmbot.System.Init.Suprevisor failed to start
** (exit) shutdown: failed to start child: Farmbot.Target.Network.Manager
** (EXIT) an exception was raised:
** (CaseClauseError) no case clause matching: "static"
(nerves_network) lib/nerves_network/if_supervisor.ex:80: Nerves.Network.IFSupervisor.manager/2
(nerves_network) lib/nerves_network/if_supervisor.ex:28: Nerves.Network.IFSupervisor.setup/2

[ . . . ]

01:29:57.838 [error] Farmbot exited: {{:shutdown, {:failed_to_start_child, Farmbot.System.Supervisor, {:shutdown, {:failed_to_start_child, Farmbot.System.Init.Suprevisor, {:shutdown, {:failed_to_start_child, Farmbot.Target.Network, {:shutdown, {:failed_to_start_child, Farmbot.Target.Network.Manager, {{:case_clause, "static"}, [{Nerves.Network.IFSupervisor, :manager, 2, [file: 'lib/nerves_network/if_supervisor.ex', line: 80]}, {Nerves.Network.IFSupervisor, :setup, 2, [file: 'lib/nerves_network/if_supervisor.ex', line: 28]}, {Farmbot.Target.Network.Manager, :init, 1, [file: 'platform/target/network/manager.ex', line: 56]}, {:gen_server, :init_it, 2, [file: 'gen_server.erl', line: 374]}, {:gen_server, :init_it, 6, [file: 'gen_server.erl', line: 342]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 249]}]}}}}}}}}}, {Farmbot, :start, [:normal, []]}}


#22

Ah cool. I know exactly what that is. I will push a fix for that tomorrow morning.


#23

Hi @JayM026, did you try the forum search about “Ports” ? [I’d love to do it for you :neutral_face:]


#24

Hoping this fix will also work for wireless ( :yum: )

Thanks ! Your Static Tester :no_mouth:


#25

Thanks for pointing this out. I believe it should work for wireless also.

Heres the silly change btw: https://github.com/FarmBot/farmbot_os/commit/0f3a45c16e9080b8f3a2d8ac7efb6bc379aaeb71


#26

Hmmm . . certainly fixes the Ethernet static IPv4 setup . . But (!)

Now can’t get a connection to https://my.farm.bot
Have to go away for a few hours now but will try to debug some more later. Here’s a snip of the first boot Logger logs :slight_smile:

01:49:07.584 [info] Beginning Bootstrap authorization: [my email] - https://my.farm.bot

01:49:07.597 [info] Child :default of Supervisor :hackney_sup started Pid: #PID<0.3126.0>
Start Call: :hackney_pool.start_link(:default, [name: :default])
Restart: :permanent
Shutdown: 10000
Type: :worker

01:49:07.601 [info] Child of Supervisor :inet_gethost_native_sup started Pid: #PID<0.3128.0>
Start Call: :inet_gethost_native.init([])

01:49:07.601 [info] Child :inet_gethost_native_sup of Supervisor :kernel_safe_sup started Pid: #PID<0.3127.0>
Start Call: :inet_gethost_native.start_link()
Restart: :temporary
Shutdown: 1000
Type: :worker

01:49:07.615 [error] Authorization failed: {:error, :nxdomain}. Trying again 4 more times.

01:49:10.134 [error] Authorization failed: {:error, :nxdomain}. Trying again 3 more times.

01:49:12.651 [error] Authorization failed: {:error, :nxdomain}. Trying again 2 more times.

01:49:15.172 [error] Authorization failed: {:error, :nxdomain}. Trying again 1 more times.

01:49:17.557 [debug] Server not configured yet. Waiting 10_000 ms to try OTA config again.

01:49:17.687 [error] Authorization failed: {:error, :nxdomain}. Trying again 0 more times.

01:49:20.202 [error] Authorization failed: {:error, :nxdomain}

01:49:27.558 [debug] Server not configured yet. Waiting 10_000 ms to try OTA config again.


#27

This is interesting. Nxdomain is a DNS error. Can you try adding 8.8.8.8 to the DNS config?


#28

Already had a valid nameserver IPv4 address configured (but also tried 8.8.8.8 :: no improvement)
Went looking at /tmp/resolv.conf and found it empty , so there’s something (maybe racy) going on when that “eth0” ‘comes up’ I think.

If I get in quick after first boot starts and I create a good /tmp/resolv.conf all is smooth sailing after that.

I’ll keep on digging.


#29

Hey all, just wanted to provide a quick update, i found out from the network team we do not block any ports besides ICMP so we shouldnt have any issues there with ports. Going to attempt a reflash on a PC of the FarmBot OS see if that helps maybe i can get this Farmbot up and running temporarily on DHCP for the time being.


#30

This is interesting. I’ll check into it a bit more. I suspect it may be something a bit lower level now. Digging into lower level libs now


#31

Hey, good luck . . :slight_smile:


#32

Oh man that made my morning. A+


#33

Good, That’s what I had hoped for (-:

Found an issue that causes my empty /tmp/resolv.conf
It’s a name miss-match in the map sent from Configurator to nerves_network app

Configurator sends name_servers: but resolvconf.ex expects nameservers:

I have a tested solution (5 files changed) if you want it.


#34

You prob’ly understand that I’m an “Ol’ Cowboy Programmer” . .
So I need to make sure that we might get Bugs fixed in this Forum ! v.s. makin’ Issues , ‘n’ Pull Requests , ‘n’ all that Formal Stuff in the **GitHub workflow ** !!
:upside_down_face:

(and, well done, getting the big 6.4.12 release into our hands !!!)


#35

Was there any resolution to the “NXDOMAIN” error?
Everytime I attemt to configure using ethernet with DHCP, the FarmBot either returns to the network configuration with a “The last time failed due to NXDOMAIN” or the GREEN LED on the box flashes and I cannot connect via web app…


#36

Hi @intelbotfarmer, for wired Ethernet using DHCP, the happy path I’ve found is to avoid using any of the Advanced options.


#37

Hi John!
I tried that, too. Failed…
But, after reading the documentation (will I never learn!) there is a section about the quirks of school networks. I am working with the school district IT folks to open a bunch of ports, and, since the FarmBot is “ping-able” I think this will resolve it. Stay tuned - I will report back results…


#38

Hey @Intelbotfarmer, you’re getting help in the right area I believe. Hopefully that static IPv4 addressing bug will be fixed and released soon, too . . but your issue is probably more about ports rather than addressing (?)

( b.t.w. ping-able may not mean success . . only that ICMP packets and routing work :expressionless: )


#39

Hey Guys,

For network troubleshooting we have posted our connectivity codes in our online documentation: