derekantrican / BambuLabsListener

4 stars 0 forks source link

Doesn't work on OSX/Linux #1

Open derekantrican opened 1 year ago

derekantrican commented 1 year ago

After installing .NET 6 on raspberry pi (curl -sSL https://dot.net/v1/dotnet-install.sh | bash /dev/stdin --channel 6.0 --architecture arm), cloning the repo, and updating settings.json, this still doesn't seem to work.

Here is the error output from MQTTnet:

Unhandled exception. MQTTnet.Exceptions.MqttCommunicationException: Value cannot be null. (Parameter 'host')
 ---> System.ArgumentNullException: Value cannot be null. (Parameter 'host')
   at MQTTnet.Implementations.CrossPlatformSocket.ConnectAsync(String host, Int32 port, CancellationToken cancellationToken)
   at MQTTnet.Implementations.MqttTcpChannel.ConnectAsync(CancellationToken cancellationToken)
   at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at MQTTnet.Adapter.MqttChannelAdapter.WrapAndThrowException(Exception exception)
   at MQTTnet.Adapter.MqttChannelAdapter.ConnectAsync(CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.ConnectInternal(IMqttChannelAdapter channelAdapter, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
   at MQTTnet.Client.MqttClient.ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken)
   at Program.<Main>$(String[] args) in /home/pi/BambuLabsListener/Program.cs:line 25
   at Program.<Main>(String[] args)

I think the raspberry pi is having trouble connecting (or even "seeing") the printer (the printer is 192.168.0.60):

pi@raspberrypi:~ $ arp -v
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.0.45             ether   ca:7c:b8:64:65:26   C                     wlan0
192.168.0.30             ether   e0:0a:f6:68:2f:ef   C                     wlan0
192.168.0.16             ether   b8:ca:3a:a6:6d:c2   C                     wlan0
192.168.0.7              ether   5c:ea:1d:a1:34:ce   C                     wlan0
192.168.0.60                     (incomplete)                              wlan0
192.168.0.6                      (incomplete)                              wlan0
www.routerlogin.com      ether   bc:a5:11:8a:de:6e   C                     wlan0
192.168.0.5              ether   e4:5f:01:82:ea:7e   C                     wlan0
Entries: 8      Skipped: 0      Found: 8
pi@raspberrypi:~ $ ping -c3 192.168.0.60
PING 192.168.0.60 (192.168.0.60) 56(84) bytes of data.
From 192.168.0.34 icmp_seq=1 Destination Host Unreachable
From 192.168.0.34 icmp_seq=2 Destination Host Unreachable
From 192.168.0.34 icmp_seq=3 Destination Host Unreachable

--- 192.168.0.60 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2042ms
pipe 3
pi@raspberrypi:~ $ nmap 192.168.0.60
Starting Nmap 7.80 ( https://nmap.org ) at 2023-09-09 11:33 PDT
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.14 seconds
pi@raspberrypi:~ $ nmap -Pn 192.168.0.60
Starting Nmap 7.80 ( https://nmap.org ) at 2023-09-09 11:33 PDT
Nmap scan report for 192.168.0.60
Host is up (0.047s latency).
All 1000 scanned ports on 192.168.0.60 are filtered

Nmap done: 1 IP address (1 host up) scanned in 6.03 seconds

So arp -v shows us that the printer can be seen, but ping & nmap are having trouble reaching it. Not sure if I need to change some setting on the raspberry pi or what.

derekantrican commented 1 year ago

I also tried this on an old Mac, but got a similar error. However, the Mac is able to ping the printer just fine

Update: MQTT Explorer doesn't even seem to work on the Mac