Arduino PySerial USB Connection

Here's the place for discussion related to CAM/CNC and the development of the Path module.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

Hi all,

I just commit a new version:
- Qt QThread in place of Python Threading. Now no need of Threading python library. All library needed is in the Workbench...
- Make like a plugin for the TinyG2 card.driver. A generic driver is provided but without file upload.
- Embed some QSemaphore for the management of free buffers on the TinyG2 card driver.


if people are ready to experiment, they are welcome ...
I have no way to test on Windows and Mac OSX ...

Thank you for experimenters
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

Hi all,

I just pushed a new version...

https://github.com/prrvchr/USBTerminal

Now we have position feed back like you can see on the screenshot...

QThread seems to be much better integrated in FreeCAD.
I am pleasantly surprised with the result.

Looking for volunteers to do some tests, I do not have the possibility on Windows and OSX.

Thank you in advance...
USBTerminalwithPositionFeedback.png
USBTerminalwithPositionFeedback.png (148.45 KiB) Viewed 5609 times
Xav-83
Posts: 97
Joined: Thu Aug 07, 2014 8:50 am

Re: Arduino PySerial USB Connection

Post by Xav-83 »

Hello,
With the last update, i can connect to GRBL shield.
Attachments
2015-10-20-235207_1368x768_scrot.png
2015-10-20-235207_1368x768_scrot.png (95.58 KiB) Viewed 5562 times
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

Hi Xav-83,

I just push a new version on GitHub, and I hope it will work well... :?

You can make test with the DefaultDriver on the "loop://" port... this is the first test... and easy it's now the default configuration!!!
After configuring your port accordingly, always with the DefaultDriver test a Terminal connection. You can not test file upload the DefaultDriver don't have...

By cons I do not test with Grbl card, which differs from the TinyG2 card?
In fact, I do not think the Grbl card is Dual End Point (you can see like two serial port on connection)...
But IMO, it is possible to develop quite easily a driver for the Grbl card... But I need more information... :roll:

Edit: Document object have changed (many times...), alway restart from scratch!!!
Last edited by prrvchr on Thu Oct 22, 2015 11:48 am, edited 2 times in total.
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

I give some screenshot of last version...

first PySerial properties monitor (read only at this time...)
PySerial monitor.png
PySerial monitor.png (240.13 KiB) Viewed 5535 times
Same thing, for TinyG2 card, you can see how many properties... (soon editable) :P
TinyG2 settings monitor.png
TinyG2 settings monitor.png (283.15 KiB) Viewed 5535 times
and small summary during file upload... with tracing positions on the screen.
TinyG2 upload monitor.png
TinyG2 upload monitor.png (231.87 KiB) Viewed 5535 times
User avatar
quick61
Veteran
Posts: 3803
Joined: Sat Aug 24, 2013 2:49 am
Location: u.S.A.

Re: Arduino PySerial USB Connection

Post by quick61 »

:shock: :P

This is starting to look really good! Keep it coming. I guess I am going to have to break down and get some Arduino hardware to start testing this out. ;)

Mark
This post made with 0.0% Micro$oft products - GOT LINUX?
Xav-83
Posts: 97
Joined: Thu Aug 07, 2014 8:50 am

Re: Arduino PySerial USB Connection

Post by Xav-83 »

Hi,
You can make test with the DefaultDriver on the "loop://" port...
For the first test in "loop: // ..." I have to get the port? in my case: / dev / ttyACM1?
when I selects my port / dev / ttyACM1 in "ports", "port" (with loop) changes directly.
after configuring your port accordingly, always with the "DefaultDriver.py" test a Terminal connection.
I connect and I can even go to the command terminal (M3, M5, G28 ....) the machine moves ^^ is excelent

I did the same test with the plugin "TinyG2plugin.py" I also happen to login.
and the machine also moves.

unfortunately I do not really know the differences between TinyG and GrblShield
what do you need to develop the driver?

it is expected to be able to control the manual machine to place the tool to his "origine" piece?

nice work, I expected after impatiently.
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

Hi,
when I selects my port / dev / ttyACM1 in "ports", "port" (with loop) changes directly
Ports is just an help for not tapping the Port name manually... But in fact you can put anything in Port but it's not sure that you arrive to connect... :lol:
We can use some keyword recognized by PySerial like: loop:// or hwgrep:// (loop:// is just a pseudo port for testing PySerial API...)
unfortunately I do not really know the differences between TinyG and GrblShield
what do you need to develop the driver?
Need some information:
For file upload, we cannot just read the file and put on serial, the computer is too fast and we have an out of buffers and panic error on Arduino card...
On the TinyG2 I can know how many free buffers is available and drive the upload speed with that... the command is "$qr" for querying the buffers availability... and I make continually while file upload...
and I think I cannot use Dual End Point connection: when you connect your Grbl card how many new port appear? (like /dev/ttyACM0)
it is expected to be able to control the manual machine to place the tool to his "origine" piece?
For now it's expected to make GCode file upload but I just test with TinyG2. I hope many more...
But I tried to make that extra driver development is easy ...
some Arduino hardware to start testing this out
you can test without... just on loop:// ;)
Xav-83
Posts: 97
Joined: Thu Aug 07, 2014 8:50 am

Re: Arduino PySerial USB Connection

Post by Xav-83 »

Hi,
I think it's grbl that limits data flow.
I read on Github GRBL but not sure.
when you connect your Grbl card how many new port appear? (like /dev/ttyACM0)
I will try to see (I am Linux beginner)

++
prrvchr
Posts: 144
Joined: Sun Oct 05, 2014 7:38 pm
Location: France

Re: Arduino PySerial USB Connection

Post by prrvchr »

Hi all,

I just released a new version...
Like you can see, now the TinyG2 TaskWatcher Monitor is editable... ;)
TinyG2 editable monitor.png
TinyG2 editable monitor.png (273.46 KiB) Viewed 5388 times
TaskWatcher work on all plugin... it's a big deal...


And specially for Xav-83 just make a new plugin for Grbl card...
I hopes it's working... :roll:
Grbl plugin.png
Grbl plugin.png (181.09 KiB) Viewed 5388 times
We can make more on the Grbl plugin, but I need more information...
in fact I need the response of different command:
$$ (view Grbl settings)
$# (view # parameters)
$G (view parser state)
$I (view build info)
$N (view startup blocks)

A copy/paste or screenshot of responses will be nice...
Post Reply