LaserWeb / deprecated-LaserWeb3

Open Source Laser Cutter / Engraver software. Supports gcode, svg, dxf, stl, png, jpg, bmp
265 stars 68 forks source link

WIFI support #138

Closed krolco closed 7 years ago

krolco commented 8 years ago

LW3 to control a WIFI attached device.

krolco commented 8 years ago

From #108:

Wifi support: Waiting on luc-github/ESP3D#112

ghost commented 7 years ago

I forked and started working on a ESP8266 firmware here https://github.com/openhardwarecoza/LaserWebEsp8266

ghost commented 7 years ago

Pushed some very early code into LW too https://github.com/openhardwarecoza/LaserWeb3/commit/59e12e2cb9af1571573ec62e555a30e07ee04c34

ghost commented 7 years ago

@arthurwolf @wolfmanjm - what is the strategy to upload file over UART?

M28 file.gcode then, send each line: Should I wait for an OK between lines? once all sent, then M29?

arthurwolf commented 7 years ago

I don't have the exact protocol in mind, but I think the reference implementation of it you want to be following, is the one in pronterface. You definitely want to wait for Ok yes. It's insanely slow though ...

On Tue, Oct 11, 2016 at 12:05 PM, Peter van der Walt < notifications@github.com> wrote:

@arthurwolf https://github.com/arthurwolf @wolfmanjm https://github.com/wolfmanjm - what is the strategy to upload file over UART?

M28 file.gcode then, send each line: Should I wait for an OK between lines? once all sent, then M29?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/openhardwarecoza/LaserWeb3/issues/138#issuecomment-252867410, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGpFd-pDjpJ3kzTwnrEXXDd-5EXbcbiks5qy19vgaJpZM4J8bQD .

Courage et bonne humeur.

ghost commented 7 years ago

Ok, got it going with waiting for 'ok' between lines. As expected, it is darn slow.

The other major stumbling block, is that during sd upload, we send faster, than the TCP buffer on the ESP8266 can flush. So i can send about 16kb of data, then i need to pause a few seconds, till the free memory heap on the esp recovers back to say 30kb free. If the head drops below 10k free, the watchdog reboots the esp :(

@darklylabs i must say, i dont think we'll manage SD uploads at all. Maybe Sneakernet (pull sd, use card reader to copy file, place sd back in machine) - wifi will have to be restricted to Jog and setup moves, and starting jobs already on SD, monitoring progress and pausing stopping actions. But at this speed, walking over to the machine to get the SD is much much faster :( - raster jobs literally take hours to upload

On Oct 11, 2016 12:07 PM, "Arthur Wolf" notifications@github.com wrote:

I don't have the exact protocol in mind, but I think the reference implementation of it you want to be following, is the one in pronterface. You definitely want to wait for Ok yes. It's insanely slow though ...

ghost commented 7 years ago

Not a surprise, but streaming jobs, also a No Go. Vector sort of works, but as can be seen in the test below, goes haywire around 60% of the way through when the heap drops. Streaming a raster job, less than 1 second of engaving later, goes bonkers.

@darklylabs Domenic, I think its time for us to discuss a "what was promised" in terms of Wifi? We can stick a simple "monitoring" app on the ESP and use Wifi (phone/tablet) as a simple UI/Dongle for driving the machine. No CAM, no Upload, no dealing with the files... Thats something I was working on for Mark Carew (OpenBuilds) already - to make the mobile device a handheld MPG. Would that strategy suffice?

img_20161011_161247 img_20161011_161250

ghost commented 7 years ago

Giving it one last test using https://github.com/Links2004/arduinoWebSockets/issues/61#issuecomment-252689452

ghost commented 7 years ago

Hold up! @Links2004 sketch seems a whole million better! I am busy streaming a raster job at the moment. Hold thumbs it finishes without a crash but so far so good!

On Oct 11, 2016 3:47 PM, "Peter van der Walt (Gmail)" < peter.plaaswerf@gmail.com> wrote:

Ok, got it going with waiting for 'ok' between lines. As expected, it is darn slow.

The other major stumbling block, is that during sd upload, we send faster, than the TCP buffer on the ESP8266 can flush. So i can send about 16kb of data, then i need to pause a few seconds, till the free memory heap on the esp recovers back to say 30kb free. If the head drops below 10k free, the watchdog reboots the esp :(

@darklylabs i must say, i dont think we'll manage SD uploads at all. Maybe Sneakernet (pull sd, use card reader to copy file, place sd back in machine) - wifi will have to be restricted to Jog and setup moves, and starting jobs already on SD, monitoring progress and pausing stopping actions. But at this speed, walking over to the machine to get the SD is much much faster :( - raster jobs literally take hours to upload

On Oct 11, 2016 12:07 PM, "Arthur Wolf" notifications@github.com wrote:

I don't have the exact protocol in mind, but I think the reference implementation of it you want to be following, is the one in pronterface. You definitely want to wait for Ok yes. It's insanely slow though ...

On Tue, Oct 11, 2016 at 12:05 PM, Peter van der Walt < notifications@github.com> wrote:

@arthurwolf https://github.com/arthurwolf @wolfmanjm https://github.com/wolfmanjm - what is the strategy to upload file over UART?

M28 file.gcode then, send each line: Should I wait for an OK between lines? once all sent, then M29?

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/openhardwarecoza/LaserWeb3/issues/138# issuecomment-252867410, or mute the thread https://github.com/notifications/unsubscribe-auth/AAGpFd- pDjpJ3kzTwnrEXXDd-5EXbcbiks5qy19vgaJpZM4J8bQD .

Courage et bonne humeur.

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/openhardwarecoza/LaserWeb3/issues/138#issuecomment-252867766, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVr2z47p1BKwBWOOL5306AACgj5JjFIks5qy1_egaJpZM4J8bQD .

ghost commented 7 years ago

img_20161011_180054

Eureka! That raster and the correct vector was both streamed over wifi! @darklylabs

ghost commented 7 years ago

Almost done: See https://plus.google.com/u/0/+PetervanderWalt/posts/7QT3xGRECSU

Todo: Add a Play Button (:

wolfmanjm commented 7 years ago

FYI you can also upload ascii files using the following protocol...

issue an upload /sd/filename.g then stream the ascii data, and send a control Z when the file is done. Do not try this while printing though as is disables normal serial communication. you can use the builtin md5sum /sd/filename to check the file and do the same on the host.

ghost commented 7 years ago

Thanks Jim! I'll try that in the morning (:

On Oct 11, 2016 8:51 PM, "Jim Morris" notifications@github.com wrote:

FYI you can also upload ascii files using the following protocol...

issue an upload /sd/filename.g then stream the ascii data, and send a control Z when the file is done. Do not try this while printing though as is disables normal serial communication. you can use the builtin md5sum /sd/filename to check the file and do the same on the host.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/openhardwarecoza/LaserWeb3/issues/138#issuecomment-253009463, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVr28hs6_enJuAVPfJ3pPY7YtPOVRz5ks5qy9qggaJpZM4J8bQD .