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

v5.1.6 can't connect to the printer on the SonicPad via Ethernet. #261

Open
CalDymos opened this issue Dec 13, 2024 · 1 comment
Open

v5.1.6 can't connect to the printer on the SonicPad via Ethernet. #261

CalDymos opened this issue Dec 13, 2024 · 1 comment

Comments

@CalDymos
Copy link

Unfortunately, adding a LAN printer does not work in version 4.3.8 or in the new version 5.1.6.
When I go to the “Device” tab and search for the printer (which is connected via the SonicPad) via “Scan Add”, the SonicPad is found. If I now select the printer via the checkbox and click on Add, the checkbox is unchecked again and nothing else happens.
If I now try to add the printer via “Manual Add” using the IP address, the error message “The printer could not be found!” appears after approx. 5 seconds.
However, the SonicPad is accessible via the browser, as well as Fluidd and Mainsail.
After analyzing the network traffic using Wireshark and reviewing the source code. (unfortunately only the source code up to version 5.0.3 is available here). I noticed that only WLAN connections (“wlan0”) are checked or queried and no Ethernet connections (“eth0” or “enps”).

Here is the relevant code snippet from the file RemotePrinterManager.cpp

...
...			
m_pKlipperInterface->getSystemInfo(session.ipAddress, session.port, [=](const std::string& ret, RemotePrinterSession printerSession) {
									RemotePrinterSession session(printerSession);
									if (ret.size() > 0)
									{
										rapidjson::Document doc;
										doc.Parse(ret.c_str());
										if (doc.HasParseError()) return;

										if (doc.HasMember("result") && doc["result"].IsObject())
										{
											const rapidjson::Value& objectResult = doc["result"];
											if (objectResult.HasMember("system_info") && objectResult["system_info"].IsObject())
											{
												const rapidjson::Value& objectSystemInfo = objectResult["system_info"];
												if (objectSystemInfo.HasMember("network") && objectSystemInfo["network"].IsObject())
												{
													const rapidjson::Value& objectNetwork = objectSystemInfo["network"];
													if (objectNetwork.HasMember("wlan0") && objectNetwork["wlan0"].IsObject())
													{
														const rapidjson::Value& objectWlan0 = objectNetwork["wlan0"];
														if (objectWlan0.HasMember("mac_address") && objectWlan0["mac_address"].IsString())
														{
															session.macAddress = objectWlan0["mac_address"].GetString();
															session.macAddress = session.macAddress + "_" + std::to_string(session.printerId);
														}
													}
												}
											}
										}
...
...

Please add Ethernet adapters to the query!

@CalDymos
Copy link
Author

If you provide the latest source code, I can make the changes and create a pull request

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

1 participant