-
Notifications
You must be signed in to change notification settings - Fork 42
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
Feature Request? Serial Connection to Pi instead of Wifi #100
Comments
It's not that easy to do so First i'd have to rewrite all networking code (it's built from the ground up for wifi), second i'd need to write a linux/pi program that actually communicates over serial. I don't see this to be in scope of the project. If you want a hardwired connection, use klipperscreen. |
Thanks for the answer! That's totally understandable and I already thought that this is too much work and out of scope. |
I disagree with the "use klipperscreen" response. I have a use for this. While it may not be within your scope of this project, I can see several use cases for this.
I think this could be done fairly easily. Would need some software on the printer side that links the Klipper API over UART to the CYD... can probably modify This is a feature I've wanted, and now I know others want it. I'll try to find some time to hack this together. |
@trueserve don't get me wrong, i completely understand the use case. Issue is that http usage runs pretty deep in the app, as i have to account for the low amount of memory quite a bit. Most responses are parsed while being streamed to save on memory usage. The project is built from the ground up for wifi I don't see this easily being possible in the current codebase. You'd likely have to abstract quite a bit |
What I looked at in the code, it doesn't look difficult. Maybe there's something I missed but it doesn't look difficult to create an abstraction. Once I get some free cycles, likely mid August I'll work on it. |
Nice suggestion. I want to use this project and connect using serial instead of wifi, as it could be laggy/unstable. Do you know if there's any progress on this topic? Were you able to implement an abstraction @trueserve? |
Reopening this issue. @zefir-o @trueserve @thomasfjen if still interested |
Thank you @suchmememanyskill great improvement! |
And also, it would be nice to describe, which changes are required from the klipper side (how to setup it). Thank you |
@zefir-o it's still in active development, so no release has been made yet. It uses usb serial for communication. That way a single usb cable can be used for power and communication. You do lose the logs and serial console while using the serial connection for printer communication. See https://github.com/suchmememanyskill/CYD-Klipper/blob/printer-interface/Manual_Install.md or compile from source from the 'printer-interface' branch if you want to try it in it's current state. The pc-side server script still needs some work, namely in the way of auto discovery. Clone this repository (again, 'printer-interface' branch), install requests |
Wow nice! Can't wait to try it out. |
@suchmememanyskill I tested it out. Great work, and thank you again for developing it! Good news: I was able to connect to the printer by connecting the display via USB to Windows. It works even if I configure the port to 80 instead of Moonraker's port. Is this intended? However, when I connected the display to Ubuntu, I'm encountering errors almost all the time. The script (serial_server) fails in various places (I think there are 2-3 different errors). Would you like a detailed report on the errors in Ubuntu? |
@zefir-o usually on printers port 80, endpoints past /api get re-routed to 7125, so should be fine I haven not tested this yet on linux. It would be great if you could send me the errors. I have pushed a new commit recently that should have better auto-detection capabilities, and also does configuration via environment variables rather than in the script. Would you mind testing that too? |
@suchmememanyskill Also, I wonder, if I can connect the display to the USB on the host machine and use RX-TX on the board directly, to make the connection more compact. Will such a setup work or do I need an adapter? |
@zefir-o Good to hear!
Can you elaborate what you mean by that? I mean, yes, as long as you can run the script on the host, and connect it over usb, you can use cyd-klipper's serial interface. For connecting through RX/TX, skipping the usb serial adapter, you can also technically do this. You'd have to hard specify the path to the serial interface though in the script through environment variables. |
@thomasfjen Oh, i forgot ubuntu devs are completely insane and don't use python's built in package manager. If you can install packages via pip3 in a venv, then set up a venv. If you do figure that out, could you send me the needed commands? |
I got it working. TBH i don't know anything regarding python but i looked at the shake&tune install script and copied over three commands from there. If i read that correctly it uses the python venv from it and it did work. |
Hi, |
I think, I found a bug. From time to time (quite often) the bed preheat buttons doesn't work. If I press "set" and enter the temp manually it works, but usage of presets 60/70 doesn't work. |
@zefir-o Cannot reproduce, can you send what it outputs in the serial console log? I expect something along the lines of
|
70 is set via the "set" bed temp button, whereas 60- using the button "60". Also, I found, that the bug is reproducible when I first set the extruder temp via any button. Otherwise, it works fine. |
Again, cannot reproduce. Clicking 200c for extruder, then 60c for bed works fine. |
🤔 I have no idea what happens. The error code seems to be ok, however setting bed temp works using "set" button and doesn't work from 60/70/0 button. |
There isn't any difference in the codes sent via serial between setting it using the set button and setting it using the preset buttons, right? |
Wait, @zefir-o does it by chance set the nozzle temperature? (like the bed temp button mistakenly sets the nozzle temp?) |
Yes, it does. |
@zefir-o Fixed in the latest commit |
Hi @suchmememanyskill , |
@zefir-o Just pushed a commit, does this lower cpu usage? |
Thank you @suchmememanyskill , |
Actually, I was confused by the Docker, and the script takes much less than the Klipper. @suchmememanyskill Sorry for confusion. Everyting nice now! |
Hello @suchmememanyskill Thank you. |
@zefir-o That sounds like an issue on your side (your serial bridge), not mine. As long as it's presented as a serial device, and you can send and receive data, you can use it. What do you mean the pc script reports 'ok'? |
I was able to run such a setup by changing:
|
I'm in doubt, how do you all compile from the printer-interface branch?.. I'm getting this error on all my Linux desktops (which still build from the Master branch just fine):
|
Wificlientsecure is a built in library. I spent a while figuring it out but it seems this is a platformio bug. Compilation on windows works fine |
On MacOS as well, but that's kinda really-really-strange... Then why does it compile on Linux x86-64 without complains for the Master branch?.. By the way, for the Master branch, ArduinoJson 7.3.0 is out, so the Master fails compiling as well.
Had to replace bblanchon/ArduinoJson@^7.0.0 to bblanchon/[email protected] in the lib_deps. |
Can you show pictures of what to do to activate the RX/TX correct transmission? |
Hello there!
Thank you for the Project! I really the like simple Display option without having to mess klipperscreen and their in relation expensive display.
I'm having frequent wifi dropouts with my screen and i was wondering if a serial connection to the pi would be also possible instead of relying on wifi. A quick google search sadly doesn't gave any results. Do you happen to know if that is possible? And if that's not too much work that would be nice a feature to have.
The text was updated successfully, but these errors were encountered: