{"id":147,"date":"2003-10-08T22:56:01","date_gmt":"2003-10-09T03:56:01","guid":{"rendered":"http:\/\/linode.siwko.org\/wordpress\/?p=147"},"modified":"2003-10-08T22:56:01","modified_gmt":"2003-10-09T03:56:01","slug":"javacomm-problems","status":"publish","type":"post","link":"https:\/\/www.siwko.org\/wordpress\/?p=147","title":{"rendered":"Javacomm Problems"},"content":{"rendered":"<p>The java comm api works well on 2 Linux boxes but not on a third. While runinng the program to write to the serial port then read back the result I was able to read directly from \/dev\/ttyS0 the expected results even though the Java program did not. The Java code used the .available() method to get a byte count. It always came back 0. When the .read() method was used, a byte was returned. I guess I&#8217;ll have to rewrite the section of code which returns results to take an expected length rather than letting the comm input drive the result size.<BR>I&#8217;m using the IBM JDK 1.4.1 on Red Hat 7 and 9. Its a COMPAQ machine with FIFO that has the problem.<BR><BR>setserial returns this: <BR>\/dev\/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4 <BR>on the working system and this: <BR>\/dev\/ttyS0, UART: 16550A, Port: 0x03f8, IRQ: 4<BR>on the non working system. I&#8217;ve got IBM JDK 1.3.0 on the working system and 1.4.1 on the non-working system. I do recall upgrading a long time ago from 1.3.0 to 1.3.1 and having the comms fail. I wonder whether the InputStream class ot the comm classes changed between 1.3.0 and 1.4.1.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The java comm api works well on 2 Linux boxes but not on a third. While runinng the program to write to the serial port then read back the result I was able to read directly from \/dev\/ttyS0 the expected results even though the Java program did not. The Java code used the .available() method [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-147","post","type-post","status-publish","format-standard","hentry","category-roller"],"_links":{"self":[{"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/147"}],"collection":[{"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=147"}],"version-history":[{"count":0,"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/147\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.siwko.org\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}