commandblockguy / terminal-ce

VT100 terminal emulator for the TI-84+ CE for use with serial devices
MIT License
25 stars 1 forks source link

terminal program quits immediately after launch #2

Closed bicknrown closed 3 years ago

bicknrown commented 3 years ago

title says it all.

TIOS version 5.3.1.0058

i've testing with nothing plugged in, as well as a prolific usb serial adapter using a mini b OTG adapter.

let me know any other relevant information you may need

commandblockguy commented 3 years ago

You'll need a font installed in order to use the terminal. The default at the moment is GOHUFONT, the source for which is included in the fonts/ directory. You can also just download the prepackaged font from my website.

I'll eventually add a proper menu for font selection, but that's a lower priority at the moment than other features. For the moment, I suppose I could print an error message using graphx's text functions so that it's less confusing as to why it's exiting.

bicknrown commented 3 years ago

Thank you for the update, I rebuilt the application to verify that it would error without the font, and it does. After adding the font, it now launches. Now i'm hitting on another problem.

Connecting the usb serial adapter shows the expected "connected" message, however, I cannot interact with it in anyway. I had it connected to minicom to attempt to send and receive data, though nothing would ever come through. I also created a serial loopback cable for testing and it also shows nothing, while working in minicom.

My current hypothesis is that the program doesn't like my serial adapters. I might be missing something big here, but let me know. (for organizations sake, let me know if i should open a new issue, given the original one is now solved.)

commandblockguy commented 3 years ago

What type of serial adapter are you using? Currently, FTDI adapters should work, as well as a direct connection to a computer, but CDC ACM devices are currently broken in such a way that I might have to majorly rewrite srldrvce to fix it.

bicknrown commented 3 years ago

It didn't occur to me to even check that the calculator itself was showing up as a serial device, that function seems to work just fine. (other than me not being able to figure out the echo mode)

The usb serial adapters I have from what i've found seem to be this model and they I believe are based off of this chipset.

Not sure how much help that will be, but I do not think they are FTDI, which would explain them not working.

commandblockguy commented 3 years ago

In theory, I support the PL2303, though I can't find the adapter I was using to test it. It likely has the same issue as CDC ACM devices, which I'll try to fix soon. It's also possible that my list of device IDs just doesn't include that particular model - if you can run lsusb and give me the line corresponding to the device, I can add it to srldrvce's list of known PL2303 devices.

bicknrown commented 3 years ago

output of lsusb: Bus 001 Device 011: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]

commandblockguy commented 3 years ago

Assuming that my PL2303 code works, that commit should in theory fix the issue.

Here's the updated srldrvce library: srldrvce.8xv.zip

bicknrown commented 3 years ago

the output is different, which is progress.

connected
Error initting serial
commandblockguy commented 3 years ago

Could you try building in debug mode by doing make clean and then make debug? That should add a specific error number to that message.

(I leave it off by default as sprintf is rather large)

bicknrown commented 3 years ago

sure thing,

connected
Error 5 initting serial

Also, I noticed while trying to make the fonts, they call for convhex, which I believe is now convbin. If you also had the tomthumb font handy, that would be appreciated.

commandblockguy commented 3 years ago

Error 5 is SRL_ERROR_NO_DEVICE, which is an error that occurs when a device's type can't be determined. I think there may have been an off-by-one error in the srldrvce version I just uploaded, let's try that again: srldrvce.8xv.zip

Here's TomThumb.8xv.

bicknrown commented 3 years ago

Still getting the same error 5 with the new srldrvce. On another note, the TomThumb font doesn't seem to be recognized when being changed in settings.c, it complains that the file is not there. the name i entered was TOMTHUMB as it appears in the calculator.

Thank you for your help thus far, this is a really cool project and i'm happy to help debug it.

commandblockguy commented 3 years ago

In that case, I'll probably have to do more extensive testing as to why it's not working. It might be helpful for me to have the entire device descriptor, which you can get by running lsusb -v -d 0557:2008. I think that the font issue is that you need to change the font index. GOHUFONT contains both bold and regular fonts at indexes 0 and 1, respectively, while TomThumb only has a single font in it. You can specify the font at index 0 as the regular font by changing the first 1 to a 0:

const struct settings default_settings = {
    "TOMTHUMB",
    0,
    0,
    0, // default colors
    {}
};
bicknrown commented 3 years ago

Here is the whole device descriptor:


Bus 001 Device 032: ID 0557:2008 ATEN International Co., Ltd UC-232A Serial Port [pl2303]
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               1.10
  bDeviceClass            0 
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0557 ATEN International Co., Ltd
  idProduct          0x2008 UC-232A Serial Port [pl2303]
  bcdDevice            3.00
  iManufacturer           1 Prolific Technology Inc.
  iProduct                2 USB-Serial Controller
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength       0x0027
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xa0
      (Bus Powered)
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol      0 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x000a  1x 10 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               0
Device Status:     0x0000
  (Bus Powered)

Changing the font index did the trick.