[NTLK] Einstein/NCX serial communication test versions as binary release.

Jake Bordens jake at allaboutjake.com
Mon Feb 20 13:58:49 EST 2017


If you have “socat” on our machine (install through homebrew) you can create a PTY in /dev that looks and acts like a serial port:

> sudo socat -d -d -d PTY,raw,mode=666,echo=0 PIPE:/Users/jake/Library/Application\ Support/Einstein\ Emulator/ExtrSerPortSend\!\!PIPE:/Users/jake/Library/Application\ Support/Einstein\ Emulator/ExtrSerPortRecv

When run, gives you:

> 2017/02/20 13:57:02 socat[98081] N PTY is /dev/ttys002
> 2017/02/20 13:57:02 socat[98081] N opening named pipe "/Users/jake/Library/Application Support/Einstein Emulator/ExtrSerPortSend" for reading
> 2017/02/20 13:57:02 socat[98081] N opening named pipe "/Users/jake/Library/Application Support/Einstein Emulator/ExtrSerPortRecv" for writing
> 2017/02/20 13:57:02 socat[98081] N starting data transfer loop with FDs [5,5] and [7,8]

The only downside is that it doesn’t enumerate as a serial port, so many apps that enumerate serial devices won’t show your emulated device.

Not sure if there’s a way to emulate what socat is doing here, or maybe we just shell out to socat to setup the device.  The end result is there is much less modification necessary to existing apps when you can point them at something in /dev


On 2/20/17, 12:30 PM, "newtontalk-bounces at newtontalk.net on behalf of Steven Frank" <newtontalk-bounces at newtontalk.net on behalf of stevenf at panic.com> wrote:

    Hi Matthias and NTLK,
    
    I just tried this out on my Mac and it worked!
    
    You should note that it requires the specific version of NCX that is downloadable on the Github page you linked to, and to make sure that NCX's preferences are pointed to the Einstein Emulator serial port.
    
    I just pushed commit 61706c4 to Einstein which replaces the deprecated FSFindFolder() and FSMakePathRef() calls with their Cocoa equivalents.  It also abstracts path discovery into a C++ class called TPathHelper, which can be ported to other platforms down the road.
    
    I'll also now give the Linux build a look and make sure it still compiles.
    
    Steven
    
    
    On Feb 16, 2017, at 11:11 PM, Matthias Melcher <mm at matthiasm.com> wrote:
    > 
    > Einstein can now emulate the external serial port of the Newton on Mac OS X. It can directly connect NCX on the same machine. 
    > 
    > It has been a lot of reverse engineering and a lot of fun. So, if you like to try this out, here is a binary release of the corresponding Mac OS X apps:
    > 
    > https://github.com/pguyot/Einstein/releases/tag/2017.2.extr
    > 
    > Feedback would be nice. Let me know what works and what doesn't, which ROM/RAM/Flash configuration you are using and which machine is emulated. Preferable by eMail to eep noise down: einstein at matthiasm.com .
    > 
    > One thing I know already: it is still pretty slow. The screenshot function takes a looong time (>1 minute), but there is also a lot of things that can be optimized. Oh, and the screenshot function works only with the original screen size.
    > 
    > - Matthias
    > 
    > ----------------------------------------------------------------------
    > 
    > http://newtontalk.net/
    > http://twitter.com/newtontalk
    
    ----------------------------------------------------------------------
    
    http://newtontalk.net/
    http://twitter.com/newtontalk
    



More information about the NewtonTalk mailing list