kervinck / gigatron-rom

System, apps and tooling for the Gigatron TTL microcomputer
BSD 2-Clause "Simplified" License
231 stars 80 forks source link

Ignore garbage data when reading chars #180

Closed blaknite closed 3 years ago

blaknite commented 4 years ago

I'm getting garbage data when using sendFile.py on my MacBook plus Arduino Uno. Ignoring the garbage by catching the exception allowed me to use the script as intended.

I'm not sure if this is the appropriate way to fix this issue, or if it is specific to my environment, so I've popped it here to open the discussion.

If there's other options to explore, let me know 😊

at67 commented 4 years ago

sendFile.py has been stable for a while now, I am curious as to what garbage you received from it? Can you provide a log?

BabelFish.ino sends a version string back to the host every time the host opens the COM port, something similar to this:

:BabelFish platform=ArduinoProMicro
:Pins:
: Gigatron data=8 latch=9 pulse=10
: Keyboard clock=3 data=4
: Controller data=5 latch=6 pulse=7
:EEPROM:
: size=1024 mapping=US
:PROGMEM slots:
: P0) BASIC
: P1) -SAVED-
:Echo off
:Type 'H' for help
:Gigatron OK
Cmd?

Could this be the garbage you are receiving?

P.S. Marcel, (the originator of this file), exclusively used a MacBook for his Gigatron development environment.

blaknite commented 4 years ago

I'll grab a log a bit later. Until then, if it's any use, it receives a whole bunch of 0xff bytes which can't be decoded before the valid gigatron responses kick in.