Open2300 - Bug Report 2016x 09x 22x 083348
You are here: Foswiki>Open2300 Web>BugReports>BugReport2016x09x22x083348 (22 Sep 2016, RomanPavlik)Edit Attach

BUG: read_safe() error: No such file or directory

ENV is open2300 ver. 1.12 running at OpenWRT 14.07 on TP-WDR4300 WiFi router. Weather station is connected by USB-to-Serial adapter based on PL2303.

I use log2300 /mnt/file.txt to obtain data from weather station. SOMETIMES log2300 ends with an error: read_safe() error: No such file or directory

I can't find any correlation of this error with machine load, cable type, etc...

Any suggestion will be very appreciated. Thank you for help, Roman rp@tns.cz

Test case

Environment

Open2300 version: 1.12
Shared libraries:  
Server OS: OpenWRT 14.07
-- RomanPavlik - 22 Sep 2016

Follow up

Fix record

The solution is described in: http://www.lavrsen.dk/foswiki/pub/Open2300/USB-SerialConverters/CODE_CHANGE
We (my wife and I) were able to get the software working with a SABRENT USB
serial adaptor (6 ft cable) running on a Dell Inspiron 660 (3.30 GHz) machine
and accessing a 3215 console. In the linux2300.c file no flow control is
activated (RTS/CTS and XON/XOFF are disabled) in the open_weatherstation()
function. So data overflow/underflow is likely with a fast machine.
We connected a breakout box to the serial line and saw no activity on the RTS
and CTS lines, so the 2315 console is evidently not using them. To get the
software to work, we had to slow down accesses! Actually only one change was
needed. A sleep was added to the write_device() function in linux2300.c:

int write_device(WEATHERSTATION serdevice, unsigned char *buffer, int size)
{
        int ret = write(serdevice, buffer, size);
        tcdrain(serdevice);     // wait for all output written
        sleep_long(1);          // sleep added here
        return ret;
}

This may be needed on any fast machine whether a USB or conventional (PCI)
serial port is used.
Topic revision: r2 - 22 Sep 2016, RomanPavlik
Copyright © 1999-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
This website only use harmless session cookies. See Cookie Policy for details. By using this website you accept the use of these cookies.