JSON server on UBUNTU missing tls/key

Can anyone point me in the right direction here? I am a relative newby in Linux. So I might be being daft.
I can’t tell what is missing/wrong. Below is part of the output that I think may have a clue.

I seem to be missing a tls/key. Is this true? if so how do I provide it. There are a couple of files bundled with the JSON server that are example certs/keys. Are these used? they have expiry dates of 2017?! Bit clueless really.

Help!

(I may have to install windows back on this old laptop)

2022/08/03 11:47:16 seriallist_linux.go:207: : 0001 () DevClass:
2022/08/03 11:47:16 seriallist_linux.go:309: Rootpath:/sys/devices/platform/pcspkr/input/input21/id, Numscanned:5
Matcheddirs:
2022/08/03 11:47:16 seriallist_linux.go:226: list of ports on this. map:map[]
2022/08/03 11:47:16 seriallist_linux.go:227: .
2022/08/03 11:47:16 seriallist_linux.go:275: Final port list: []
2022/08/03 11:47:16 main.go:200: Attempting to load Cayenn TCP/UDP server on port 8988…
2022/08/03 11:47:16 main.go:219: The Serial Port JSON Server is now running.
2022/08/03 11:47:16 main.go:220: If you are using ChiliPeppr, you may go back to it and connect to this server.
2022/08/03 11:47:16 main.go:255: Missing tls cert and/or key. Will not start HTTPS server.
2022/08/03 11:47:16 serial.go:123: Inside run of serialhub
2022/08/03 11:47:16 cayenn.go:59: Error creating Cayenn UDP server. Consider using -disablecayenn command line switch to turn off the Cayenn TCP/UDP server. Error: listen udp :8988: bind: address already in use
2022/08/03 11:47:16 cayenn.go:401: Error creating Cayenn TCP server. Consider using -disablecayenn command line switch to turn off the Cayenn TCP/UDP server. Error: listen tcp :8988: bind: address already in use
2022/08/03 11:47:16 main.go:235: Starting http server and websocket on 192.168.1.112:8989
Error trying to bind to http port: listen tcp :8989: bind: address already in use, so exiting…
This can sometimes mean you are already running SPJS and accidentally trying to run a second time, thus why the port would be in use. Also, check your permissions/credentials to make sure you can bind to IP address ports.2022/08/03 11:47:16 main.go:239: Error ListenAndServe:listen tcp :8989: bind: address already in use

The “Missing tls cert and/or key. Will not start HTTPS server.” line is calling out that you haven’t provided the certs needed to run HTTPS but I don’t think that is your problem because you can still run HTTP.

The later message “Error trying to bind to http port: listen tcp :8989: bind: address already in use, so exiting…” is the actual error.

Try running ‘ss -lpn | grep 8989’. That should show if you already have something listening on that port

2 Likes

Thanks for the advice Ralph.
You are correct the problem isn’t tls cert. I got fed up and put the old Win 7 OS back on. And I still had the same problem!!
I had a hunch that as my cnc pcb engraver is driven by an arduino nano I might need any or all of the driver associated with that. So I installed the IDE and all the drivers and bingo! Another port appeared with “340CH USB serial” appeared and it worked. I guess this was missing from the Ubuntu attempt. I am tempted to reinstall ubuntu and try again - trouble it I’m a bit tired of this right now and want to cut a board. So maybe I’ll revisit it in the future.

1 Like

Ubuntu Linux already has support for CH340 USB chips so it’s likely you could see the device created with the ‘dmesg’ command. Generally looks like /dev/ttyUSB0 but can be /dev/ttyACM0 but I’m surprised that wasn’t mentioned in the installation/setup instructions.

It does look like there was an issue with the port number so maybe switching to another OS changed that problem and you ended up with another problem related to the device driver which is common on Windows. Had you typed in the 'ss -lpn | grep 8989’ command you would likely have seen what was using 8989 and causing the problem.

2 Likes

Sadly I had already started to install Win7 before I saw the ss suggestion. I did try killing what ever what binding to port 8988. This caused it to initially look like it was working, but I had dozens of TTL ports all numbered and when I tried to connect threw an error. It was whilst trying to see if any of these worked that I got fed up and put Win7 back. None had any readable text like 340CH USB etc.

Ahh ss is similar to netstat -tunlp, which I did do. Which again did not report any text I could see that looked like 340CH etc. I used it to see that 8988 was bound but 8989 wasn’t and to check I had released it when I used fused to kill it.

Hey ho, I need to build up a head of steam to try again, maybe in a week or two.

Yeah, the default device names don’t give as much information. There can be a lot of information in the kernel messages but the default names are simple. But at such time as you want to give it another try we can help. :smiling_face:

1 Like

the kernel messages, from dmesg command can look like this. I just plugged in an arduino and the 2nd to last line shows ttyUSB0 as the device so the correct path for the device would be /dev/ttyUSB0

[917273.040290] usb 3-1: new full-speed USB device number 4 using xhci_hcd
[917273.189581] usb 3-1: New USB device found, idVendor=1a86, idProduct=7523, bcdDevice= 2.54
[917273.189588] usb 3-1: New USB device strings: Mfr=0, Product=2, SerialNumber=0
[917273.189592] usb 3-1: Product: USB2.0-Serial
[917273.273778] usbcore: registered new interface driver usbserial_generic
[917273.273801] usbserial: USB Serial support registered for generic
[917273.276445] usbcore: registered new interface driver ch341
[917273.276510] usbserial: USB Serial support registered for ch341-uart
[917273.276543] ch341 3-1:1.0: ch341-uart converter detected
[917273.277876] usb 3-1: ch341-uart converter now attached to ttyUSB0
(base) maker@Maker-MacBookAir:~/Downloads$

1 Like

@vinpar following up on @dougl’s great example, you can plug it in and run this command in a terminal:

sudo dmesg | grep ch341

Guys! Such a helpful bunch!
I can feel the motivation coming back. I would prefer to get into linux. I will definately give it a go soon.
Cheers

2 Likes