PrusaLink MAC not stable, local host name not allways working
Powering up the printer and after Prusa Link boot, I had a message No lan access. I switched off and then on the printer, but after new boot I had the same message. A Scan of my LAN with Advanced IP Scanner, verified that Prusa Link had not been connected. As I was searching the internet for a solution, sometime I saw the message Prusa Link OK. Trying to connect with the hostname I have ginven to it at setup, there was not any connection. And the IP that I have reserved in my rooter for the printer MAC was not the same as before. Checking again the LAN, I found that printer has changed MAC! I configured my router with the new MAC, but still unable to log with the "server" name. So I had to log using the IP.
Then I set up my router for the 2 different MAC addresses to have 2 specific IPs, in order to do not search each time for the random IP assigned by the router. Some times I can see PrusaLink by the "server"" name, some others I do not.
Do you have an idea what could be wrong? Is it normal to change MAC address, and how I can prevent it?
I have seen that there is a file in the Linux area of SD card that can be edited to assign a fixed IP (but not MAC), and set everything for PrusaLink. But my PC is running Windows 10, and the Ext2 Volume Manager can read the files, but not edit them (because they are "protected"). Can I set these options with a file in Windows area of SD? If not, is there any way to "unprotect" the filew (or folders) I want to edit from Windows? This could be very helpfull, because there is another bug in Prusa Link. If by error a is uploaded a file that is not gcode (for example an 3mf one), there is no option to delete it.
RE: PrusaLink MAC not stable, local host name not allways working
Please provide more details about the hardware hat PrusaLink is running.
If this is a Raspberry Pi with ethernet and wifi then you can just see two interfaces on the same network, which is normal, you would need IP per each of them set in DHCP server you use.
The best option to edit files is to use SSH client on windows ( for example putty.exe) to connect to the host ( I believe default username is 'jo' and password is 'raspberry') and then use sudo to become a root user to be able to edit certain files. The most convenient basic editor is nano.
There is an option to set static MAC address to the interface on the Linux. Also there is option to generate random MAC to improve anonymity, but that's another story....
See my GitHub and printables.com for some 3d stuff that you may like.
RE: PrusaLink MAC not stable, local host name not allways working
The hardware is Raspberry Pi W2 Zero with wifi purchased from Prusa store, on a MK3S+.
There are no two interfaces at the same time, the link IP is using randomly one of them, sometimes while been active! I do not find that normal. Also the use of declared "server" name it is not allways working, I have to use the IPs, testing wich is active.
And please add a delete option for files other than code.
RE: PrusaLink MAC not stable, local host name not allways working
I used putty.exe to connect, but user 'jo' (or 'pi' as indicated in some forums) with password 'raspberry' did not worked.
I have been connected using my username and password that I have declared during software setup. I tried to edit the prusa_printer_settings.ini file, but the software is periodialy replacing it by the "original", so any edidting I do is lost. I was listing the file, periodically, and the date is changing almost every minute (or earlier), without any action from me, and the printer in idle mode. I do not know if the messages HTTP error 5xx or the No Internet Access that I am getting some times has something to do with this .
In any case, is there anybody that can give SPESIFIC guidance about where are the "source" files that have the network info etc (and not those recreated by the system)? Also give an answer why Internet access is not allways active, why sthe "server" name for the LAN is not allaways woarkking, and why the MAC address is getting (randomly) 2 different values (and not only at intiial setup, but also as it is printing!) ?
It is very anoying to use two different shortcuts in a mobile phone to see the status of the printer, or to be not able to see it when out of home.
PS: Booting many times the printer to see how Prusa Link performs, I found that when it is using one MAC address it is connected to the Internet, but when using the other one it is not (giving the errors mentioned above). But both of them are working properly in the LAN (except that some times the "server" name is not responding, I have to log using IP). There is not any "pattern" on which MAC it will use.
RE: PrusaLink MAC not stable, local host name not allways working
Searching more in deep, the two MAC addresses the W2 Zero is randomly using have the same 3 LS bytes. So I suppose that Network manager is not changing it, as it is declared in the configuration file.
But the 3 MS bytes are different. The one that is working properly is B8:27:EB, that according to https://hwaddress.com/oui-iab/B8-27-EB/ is assigned to Raspberry Pi Foundation. The other one that can't be connected to the internet is E4:C3:2A, that is assigned to ... TP-LINK TECHNOLOGIES CO.,LTD ! So as I understand, the W2 Zero software is not selecting its "own" MAC company, but is getting that of the roouter or the wifi transmitter (both are TP-Link)! I thnk this is a software bug, that it should be corrected.
I tried to "solve" this issue by forcing the software to use the proper MAC address, as described in the README file found in Windows readable partition of W2 Zero SD Card, folder /overlays. I added the following parameter in config.txt file, that is in root folder:
#wifi Address
dtparam=wifiaddr=b8:27:eb:xx:xx:xx
where in xx:xx:xx I placed the "constant" 3 LS bytes that the W2 Zero is using.
Unfortunatelly this did not had any influence, the W2 Zero still is using randomly both MAC addresses.
RE: PrusaLink MAC not stable, local host name not allways working
I loged to the W2 Zero while it was using the "wrong" (TP_Link) MAC address, and I run the ifconfig command. The result was completely confusing:
The IP was refered as 192.168.1.19 and the MAC address as b8:27:eb..., that is the Raspberry code. But at the same time Advanced IP Scanner was indicating that this IP has MAC e6:c3:2a... , the TP-Link code!!! The MK3S+ display was showing the info HTTP Error 5XX, and then ->see 192.168.1.19. Also all the details shown by the command nmcli device show, were equal to these when the correct MAC address was used (except the IP, 192.168.1.20). MAC address shown by linux commands is allways the correct one.
This is tottaly mad, some software (or hardware firmware ?) is taking command on the Wifi changing MAC address. While linux Network Manager has no information about that. Very peculiar bug ...
PS: As I was rebooting the printer trying to have the wrong MAC address, a new problem was created: The W2 Zero started with the wrong IP, but then it was blocked at the status Starting PrusaLink.
RE: PrusaLink MAC not stable, local host name not allways working
some things to test:
- ensure to set proper country for wifi config
- look at the tplink/rpi logs if any
- ensure not to have the same SSID for 2.4 and 5GHz networks
- try to use just accesspoints with ethernet cables between them, and not wifi mesh
- set dhcp lease time to something short like 10 minutes
- try to find if tplink has some special options for 'legacy' clients and experiment with this
See my GitHub and printables.com for some 3d stuff that you may like.
RE: PrusaLink MAC not stable, local host name not allways working
You mean that in order to make PrusaLink to work properly I must use different SSIDs for 2.4 & 5 GHz and make the "jump" from one to another more dificult for my mobile phones, install cables in my house to avoid repeaters, and so having at least 4 SSIDs, 2 in 2.4 GHz and 2 in 5.
No, thanks, I will not change my setup in order to make PrusaLink to work properly. IT HAS to work with such condition as any other device does.
Lease time does not has any role, while IPs are reserved for PrusaLink, as also my PCs, mobile phones, security cameras, and generally all the "constant" devices I have in my house. Country is OK (gr), and I changed the wifi to all types of 802.11 communication b/g/n mixed (from g/n mixed) and disabled GI.
Also I set off the 5G SSID, shut down the repeater, but nothing changed. Actually the new "behavior" is that the system is staying infinitely in the Starting Prusalink status ...
So as an ultimate action I reloaded the software to the SSD card and powered up the printer. Then waited for ~10 minutes for the initial setup, and then I saw the message ->Go: 192.168.1.20, meaning the correct MAC. Rebooting printer, IP remained the same.
Future will show if problem has been solved. If yes, the only "external" change I did was to set the wifi from from g/n mixed to b/g/n mixed. But this did not solved the problem in the previous software installation. Is this wifi setup "guides" the software to make permanent changes on the MAC address (asking the 3 MSB from the wifi station), and finaly block the system? I do not know how the MAC "creator" works.
I will come back after some days to inform you if the problem has been solved. If yes, you must add an instruction to the PrusaLink Guide for the Wifi station setup to include all 802.11 versions (and then try to find why this peculiar behavior happens). If not ...
RE: PrusaLink MAC not stable, local host name not allways working
I just suggest two SSID networks, for 2.4GHz and 5GHz, and cables to access points because I saw few times such issues on mixing old devices to newer networks (especially on ac, though...).
About DHCP settings, I remember certain devices had issues with leases over certain values ( even with static assignments), but usually that was some old bugs on routers or DHCP clients.
Switching to b/g/n which hopefully works may mean that older devices on the network may not support modern features for the wifi networks. But this may also mean that network client/drivers on pi zero are older, and thus that's why there is a mess only with that device.
Forcing Mac address on the device itself as kernel parameter or network config should really not be needed.
I remember that PrusaLink is on older Raspberry Os due to various reasons, so maybe it is related.
You could try to use new os to see if the wifi is stable, but then you probably hit the issue that PrusaLink from pip install does not support newer camera modules on the newer os. So in the end you would hit the other wall, unfortunately.
I can feel your frustration, because I had other issues with network devices from Prusa printers over the Ethernet cables ( and reading enough about the wifi modules I dropped the idea of getting one).
I am not affiliated with Prusa company in any way, and certain decisions they made were pretty surprising at least. I hope you will get your issue solved, though.
See my GitHub and printables.com for some 3d stuff that you may like.
RE: PrusaLink MAC not stable, local host name not allways working
Sorry, I thought you are a Prusa programmer. If the problem insists, I prefer to use an other wifi network with another SSID in another channel, to attach any "old type" wifi device, and set the main one for best speed (for all new devices). But probably I will not do it, since I am going to upgrade the printer to 3.5S version, which has cable ethernet capability.
As for the rooters, I know all these problems, so I am using a "good" one (TL-ER605), with 2 WAN lines and a lot of devices on the LAN that can be serviced without any problem.
Finally I do not use the camera input of the W2 Zero, I connected the USB camera to a mini PC that is 24 h on acting as a file and security server in my LAN. So I can see the printer even with 15 fps and not with a picture every X seconds (I use the free Yawcam application to stream the USB camera).
RE: PrusaLink MAC not stable, local host name not allways working
Setting b/g/n mixed in the wifi station had no impact on the problem, W2 Zero connected again with a MAC address as it was a TP-Link device. I reloaded the sodtware in SD card to make a "clean" start, without assigning a specific IP in my router, and this also had no impact on the bug. The W2 Zero about 1 of 4 times is connected as TP-Link device and the other as Raspberry one.
The very peculiar situation is when is is connected as a TP-Link device, where Advanced IP Scanner is reporting it with the MAC E6:C3:2A:6E:E2:1E, but Prusa Connect is reporting b8:27:eb:6e:e2:1e !!! Also connecting to the W2 Zero with SSH and asking for connection data, MAC address is also the Raspberry one! THis is definitely a bug in software and has nothing to do with any other setup.
I tried also to set a fix IP on the W2 Zero, as it is proposed by using the prusa_printer_settings.ini file, adding a section [wifi::ipv4]. It was ignored ...
So we have to do with a bug in the software, do anyone has an idea how this can be reported to Prusa?
RE: PrusaLink MAC not stable, local host name not allways working
I found how to set fixed IP to PrusaLink in a W2 Zero file and not assigning an IP in the router (as MAC is changing).
Even if it is written in guide that can be set by prusa_printer_settings.ini file, this it is not working. So searching I found a file that is created after the first boot, found in folder /etc/NetworkManager/system-connections, named as preconfigured.nmconnection.
This file has data for the wifi and LAN, including a section named [ipv4]. Under this is an entry method=auto, meaning the router will provide an IP.
This can be edited (through SSH connection, using sudo nano) and replaced by these entries (in my case IP=192.168.1.20, router 192.168.1.1):
method=manual
address=192.168.1.20/24 (the IP must be followed by /24)
gateway=192.168.1.1
dns=192.168.1.1
There is also a capability of adding an entry dns-search, but it is not needed. Now my printer has this IP without requesting one from the router. The System Log of the router does not "announce" any IP assignment, as it is not asked. It is obvious that the selected IP should be out of the area the router is using for DHCP.
I will monitor now the MAC address that will be used by the printer, if it still is using occasionaly the 3MSB of TP-Link company ...