Hi all,
We are here with Olivier taking a loot at how serial ports work, because he wants to use it to connect to arduino/raspberries.
We saw that the serial port works nice in unix, in windows we had a look but we found some problems (and we do not have now a windows machine to test well), and we found that in mac it does not work. We are seeing that this behaviour is there since Pharo 3 (4 years ago).
We tried to see if it was a problem of the VM plugin (missing depenencies using ld / otool) but everything seemed ok.
Finally, we took the vm from git and tried to compile it from scratch.
*Meta-question 1:* Is there a way to create an xcode project from the vm sources? We would have lost less time if we used a graphical debugger to take a look at this :).
There, we found that - apparently the mac VM is using an empty implementation of the serial port plugin:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac%20O...
We replaced the contents of that file by the one in the Unix plugin and it worked *when the plugin was compiled as internal* (delta some differences between the default values in mac and unix like uppercasing the 's' of ttyS and ttys)
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/pl...
However, as soon as we retried to recompile the plugin as external it did not work any more... The initializeModule function was never called, the module was not loaded (from the system report) and the Serial port could not be open. For this we would have liked a debugger. And I'm not a friend of gdb on the terminal...
*Meta-question 2:* Is there any clean/make clean used to remove generated files. We found ourselves a lot of times bitten by the fact that even recompiling everything using `mvm -A` did not really recompile and we had to remove files from here and there...
How should we propose a fix? - do we duplicate the code of the plugin in the mac and unix platforms? - or do we somehow tell the compilation process that for this plugin it should use the sources in the unix platform code?
Thanks! Guille and Olivier
On 24 Mar 2017, at 15:07, Guillermo Polito guillermopolito@gmail.com wrote:
Hi all,
We are here with Olivier taking a loot at how serial ports work, because he wants to use it to connect to arduino/raspberries.
We saw that the serial port works nice in unix, in windows we had a look but we found some problems (and we do not have now a windows machine to test well), and we found that in mac it does not work. We are seeing that this behaviour is there since Pharo 3 (4 years ago).
We tried to see if it was a problem of the VM plugin (missing depenencies using ld / otool) but everything seemed ok.
Finally, we took the vm from git and tried to compile it from scratch.
Meta-question 1: Is there a way to create an xcode project from the vm sources? We would have lost less time if we used a graphical debugger to take a look at this :).
No. What you do is to create an empty project and then attaching the running vm.
Esteban
There, we found that
- apparently the mac VM is using an empty implementation of the serial port plugin:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac%20O... https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac%20OS/plugins/SerialPlugin/sqMacSerialPort.c
We replaced the contents of that file by the one in the Unix plugin and it worked when the plugin was compiled as internal (delta some differences between the default values in mac and unix like uppercasing the 's' of ttyS and ttys)
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/pl... https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/plugins/SerialPlugin/sqUnixSerial.c
However, as soon as we retried to recompile the plugin as external it did not work any more... The initializeModule function was never called, the module was not loaded (from the system report) and the Serial port could not be open. For this we would have liked a debugger. And I'm not a friend of gdb on the terminal...
Meta-question 2: Is there any clean/make clean used to remove generated files. We found ourselves a lot of times bitten by the fact that even recompiling everything using `mvm -A` did not really recompile and we had to remove files from here and there...
How should we propose a fix?
- do we duplicate the code of the plugin in the mac and unix platforms?
- or do we somehow tell the compilation process that for this plugin it should use the sources in the unix platform code?
Thanks! Guille and Olivier
There is Apple documentation for this in:
https://developer.apple.com/library/content/documentation/Porting/Conceptual... https://developer.apple.com/library/content/documentation/Porting/Conceptual/PortingUnix/preparing/preparing.html On 24 Mar 2017, at 09:13, Esteban Lorenzano estebanlm@gmail.com wrote:
On 24 Mar 2017, at 15:07, Guillermo Polito <guillermopolito@gmail.com mailto:guillermopolito@gmail.com> wrote:
Hi all,
We are here with Olivier taking a loot at how serial ports work, because he wants to use it to connect to arduino/raspberries.
We saw that the serial port works nice in unix, in windows we had a look but we found some problems (and we do not have now a windows machine to test well), and we found that in mac it does not work. We are seeing that this behaviour is there since Pharo 3 (4 years ago).
We tried to see if it was a problem of the VM plugin (missing depenencies using ld / otool) but everything seemed ok.
Finally, we took the vm from git and tried to compile it from scratch.
Meta-question 1: Is there a way to create an xcode project from the vm sources? We would have lost less time if we used a graphical debugger to take a look at this :).
No. What you do is to create an empty project and then attaching the running vm.
Esteban
There, we found that
- apparently the mac VM is using an empty implementation of the serial port plugin:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac%20O... https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac%20OS/plugins/SerialPlugin/sqMacSerialPort.c
We replaced the contents of that file by the one in the Unix plugin and it worked when the plugin was compiled as internal (delta some differences between the default values in mac and unix like uppercasing the 's' of ttyS and ttys)
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/pl... https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/plugins/SerialPlugin/sqUnixSerial.c
However, as soon as we retried to recompile the plugin as external it did not work any more... The initializeModule function was never called, the module was not loaded (from the system report) and the Serial port could not be open. For this we would have liked a debugger. And I'm not a friend of gdb on the terminal...
Meta-question 2: Is there any clean/make clean used to remove generated files. We found ourselves a lot of times bitten by the fact that even recompiling everything using `mvm -A` did not really recompile and we had to remove files from here and there...
How should we propose a fix?
- do we duplicate the code of the plugin in the mac and unix platforms?
- or do we somehow tell the compilation process that for this plugin it should use the sources in the unix platform code?
Thanks! Guille and Olivier
BTW there is the SerialExtendedUnixPlugin which I wrote back in 2003. Check the mail list archives for threads on running it on OS X as it exposes why more fiddly bits of the Unix serial I/O logic.
On Fri, Mar 24, 2017 at 8:13 AM, Javier Diaz-Reinoso javier_diaz_r@mac.com wrote:
There is Apple documentation for this in:
https://developer.apple.com/library/content/documentation/ Porting/Conceptual/PortingUnix/preparing/preparing.html
On 24 Mar 2017, at 09:13, Esteban Lorenzano estebanlm@gmail.com wrote:
On 24 Mar 2017, at 15:07, Guillermo Polito guillermopolito@gmail.com wrote:
Hi all,
We are here with Olivier taking a loot at how serial ports work, because he wants to use it to connect to arduino/raspberries.
We saw that the serial port works nice in unix, in windows we had a look but we found some problems (and we do not have now a windows machine to test well), and we found that in mac it does not work. We are seeing that this behaviour is there since Pharo 3 (4 years ago).
We tried to see if it was a problem of the VM plugin (missing depenencies using ld / otool) but everything seemed ok.
Finally, we took the vm from git and tried to compile it from scratch.
*Meta-question 1:* Is there a way to create an xcode project from the vm sources? We would have lost less time if we used a graphical debugger to take a look at this :).
No. What you do is to create an empty project and then attaching the running vm.
Esteban
There, we found that
- apparently the mac VM is using an empty implementation of the serial
port plugin:
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/Mac% 20OS/plugins/SerialPlugin/sqMacSerialPort.c
We replaced the contents of that file by the one in the Unix plugin and it worked *when the plugin was compiled as internal* (delta some differences between the default values in mac and unix like uppercasing the 's' of ttyS and ttys)
https://github.com/OpenSmalltalk/opensmalltalk-vm/blob/Cog/platforms/unix/ plugins/SerialPlugin/sqUnixSerial.c
However, as soon as we retried to recompile the plugin as external it did not work any more... The initializeModule function was never called, the module was not loaded (from the system report) and the Serial port could not be open. For this we would have liked a debugger. And I'm not a friend of gdb on the terminal...
*Meta-question 2:* Is there any clean/make clean used to remove generated files. We found ourselves a lot of times bitten by the fact that even recompiling everything using `mvm -A` did not really recompile and we had to remove files from here and there...
How should we propose a fix?
- do we duplicate the code of the plugin in the mac and unix platforms?
- or do we somehow tell the compilation process that for this plugin it
should use the sources in the unix platform code?
Thanks! Guille and Olivier
On Fri, Mar 24, 2017 at 08:58:50AM -0700, John McIntosh wrote:
BTW there is the SerialExtendedUnixPlugin which I wrote back in 2003. Check the mail list archives for threads on running it on OS X as it exposes why more fiddly bits of the Unix serial I/O logic.
We have this:
http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platforms/Mac%20OS/plugi...
Is there Smalltalk (slang) that goes with it for generating the plugin?
Dave
yes the *.c file is generated by slang, let me attach the *.c files I have from an archive, but that likely won't work as it's not generated as 64bit clean
On Fri, Mar 24, 2017 at 5:07 PM, David T. Lewis lewis@mail.msen.com wrote:
On Fri, Mar 24, 2017 at 08:58:50AM -0700, John McIntosh wrote:
BTW there is the SerialExtendedUnixPlugin which I wrote back in 2003.
Check
the mail list archives for threads on running it on OS X as it exposes
why
more fiddly bits of the Unix serial I/O logic.
We have this:
http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/ platforms/Mac%20OS/plugins/SerialExtendedPlugin/
Is there Smalltalk (slang) that goes with it for generating the plugin?
Dave
Also I guess the current corrected changes set
On Fri, Mar 24, 2017 at 5:32 PM, John McIntosh < johnmci@smalltalkconsulting.com> wrote:
yes the *.c file is generated by slang, let me attach the *.c files I have from an archive, but that likely won't work as it's not generated as 64bit clean
On Fri, Mar 24, 2017 at 5:07 PM, David T. Lewis lewis@mail.msen.com wrote:
On Fri, Mar 24, 2017 at 08:58:50AM -0700, John McIntosh wrote:
BTW there is the SerialExtendedUnixPlugin which I wrote back in 2003.
Check
the mail list archives for threads on running it on OS X as it exposes
why
more fiddly bits of the Unix serial I/O logic.
We have this:
http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platform s/Mac%20OS/plugins/SerialExtendedPlugin/
Is there Smalltalk (slang) that goes with it for generating the plugin?
Dave
--
=============== John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk ============================================================ ===============
Thanks John!
Dave
On Fri, Mar 24, 2017 at 05:38:00PM -0700, John McIntosh wrote:
Also I guess the current corrected changes set
On Fri, Mar 24, 2017 at 5:32 PM, John McIntosh < johnmci@smalltalkconsulting.com> wrote:
yes the *.c file is generated by slang, let me attach the *.c files I have from an archive, but that likely won't work as it's not generated as 64bit clean
On Fri, Mar 24, 2017 at 5:07 PM, David T. Lewis lewis@mail.msen.com wrote:
On Fri, Mar 24, 2017 at 08:58:50AM -0700, John McIntosh wrote:
BTW there is the SerialExtendedUnixPlugin which I wrote back in 2003.
Check
the mail list archives for threads on running it on OS X as it exposes
why
more fiddly bits of the Unix serial I/O logic.
We have this:
http://squeakvm.org/cgi-bin/viewvc.cgi/squeak/trunk/platform s/Mac%20OS/plugins/SerialExtendedPlugin/
Is there Smalltalk (slang) that goes with it for generating the plugin?
Dave
--
=============== John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk ============================================================ ===============
--
John M. McIntosh. Corporate Smalltalk Consulting Ltd https://www.linkedin.com/in/smalltalk ===========================================================================
On 24-03-2017, at 7:07 AM, Guillermo Polito guillermopolito@gmail.com wrote:
Hi all,
We are here with Olivier taking a loot at how serial ports work, because he wants to use it to connect to arduino/raspberries.
In the case of Pi’s don’t forget that there are much faster ways to connect; even the oldest Pi’s have ethernet and Pi3’s have wifi & bluetooth built in. Opening a net connection to a Pi is likely to be much more useful than restricting yourself to serial. I’m sure you’re not making the mistake I see too often of people thinking a Pi is a microcontroller like an Arduino when it is actually a quite powerful computer with a real OS...
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Hard work pays off in the future. Laziness pays off now.
Hi all, thanks for the answers,
First, we managed to debug the VM using Xcode (thanks Esteban :)). We found that when the serial plugin is compiled as external plugin in Mac, the VM does not load it because it cannot find the setInterpreter function, which is strange. We will continue digging here...
John, I checked the code of sqMacSerialExtended and uses Carbon libraries. Isn't the VM moving out from it because it's not supported any more? Besides, in Mac we can use unix libraries like termios...
Tim, Yes, we know. We just wanted to do a tutorial on playing with arduino and we saw that the serial plugin was not working... We thing that independently of what we are doing with it, serial port should be fixed :)
Guille
On Tue, Mar 28, 2017 at 2:08 AM, tim Rowledge tim@rowledge.org wrote:
On 24-03-2017, at 7:07 AM, Guillermo Polito guillermopolito@gmail.com
wrote:
Hi all,
We are here with Olivier taking a loot at how serial ports work, because
he wants to use it to connect to arduino/raspberries.
In the case of Pi’s don’t forget that there are much faster ways to connect; even the oldest Pi’s have ethernet and Pi3’s have wifi & bluetooth built in. Opening a net connection to a Pi is likely to be much more useful than restricting yourself to serial. I’m sure you’re not making the mistake I see too often of people thinking a Pi is a microcontroller like an Arduino when it is actually a quite powerful computer with a real OS...
tim
tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Hard work pays off in the future. Laziness pays off now.
On 28-03-2017, at 7:44 AM, Guillermo Polito guillermopolito@gmail.com wrote:
Tim, Yes, we know. We just wanted to do a tutorial on playing with arduino and we saw that the serial plugin was not working... We thing that independently of what we are doing with it, serial port should be fixed :)
Absolutely. Serial ports that don’t work are not terribly helpful.
You’d be amazed how often I do see people asking effectively “how do I program a raspberrianpie? I can’t find Arduino libraries for it”. Of course they tend to be the same sort of people that try to tell me that linux can only run on x86 machines, that Apple stole linux and tried to make it closed source but Microsoft bravely fought them off, that Harley’s are motorcycles, and that C++ was predicted by {religious tract of their choice}, etc.
Ooh, look; my random sigline chooser found an amazingly apropos sigline to describe such people!
tim -- tim Rowledge; tim@rowledge.org; http://www.rowledge.org/tim Useful random insult:- Solid concrete from the eyebrows backwards.
vm-dev@lists.squeakfoundation.org