Raspberry Pi Bad file number

I have installed WD on my raspberry Pi 4 and it starts to run. After several hours it reports errors. What do I need to correct thiserror?

Here is a copy of the consolewd screen report.

Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Connecting TCP/IP 192.168.110.22 22222
Connecting TCP/IP 192.168.110.22 22222
Bad file number
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Connecting TCP/IP 192.168.110.22 22222
Connecting TCP/IP 192.168.110.22 22222
Bad file number
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Connecting TCP/IP 192.168.110.22 22222
Connecting TCP/IP 192.168.110.22 22222
Bad file number
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
Requesting LOOP data from IP
**** doing minute routines now 13:31:01
**** updating clientraw extra files
**** updating data logs
re creating the main logfile 42020
updating records to ini file
Unable to create file “/home/pi/consolewdfiles/wdconsole.ini”

do you have an IP data logger?

Yes I have an IP data Logger

the IP address you have set does not look correct
(too many numbers)

IP address is 192.168.110.22 and port is 22222

This is correct. when the program starts, it reads correctly for a couple of hours then gets this error.

here is first read from Davis Weather Envoy

Connecting TCP/IP 192.168.110.22 22222
Connecting TCP/IP 192.168.110.22 22222

Requesting LOOP data from IP
Requesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK
Current data 20:08:39: Temperature= 39.2 Windspeed =0.0 Gustspeed =0.0 Direction =198 Humidity=78 Barometer=29.7 Daily Rain=6.4 Rain Rate 0.0mm/minRequesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK
Current data 20:08:40: Temperature= 39.2 Windspeed =0.0 Gustspeed =0.0 Direction =198 Humidity=78 Barometer=29.7 Daily Rain=6.4 Rain Rate 0.0mm/minRequesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK
Current data 20:08:40: Temperature= 39.2 Windspeed =0.0 Gustspeed =0.0 Direction =198 Humidity=78 Barometer=29.7 Daily Rain=6.4 Rain Rate 0.0mm/minRequesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK
Current data 20:08:41: Temperature= 39.2 Windspeed =0.0 Gustspeed =0.0 Direction =198 Humidity=78 Barometer=29.7 Daily Rain=6.4 Rain Rate 0.0mm/minRequesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK
Current data 20:08:41: Temperature= 39.2 Windspeed =0.0 Gustspeed =0.0 Direction =198 Humidity=78 Barometer=29.7 Daily Rain=6.4 Rain Rate 0.0mm/minRequesting LOOP data from IP
raw vp baro 1004.6
raw vp temp 4.0
Vpsolar = 32767
Davis Data OK

oh it was not very clear that its OK initially
googling shows this solution

I also got the same error 9. For me it was the Linux lock file for that port not being cleared up. My solution is to put this line before the connection code starts: ser.LinuxLock:=False; //lock file sometimes persists stuck if program closes before port

do you happen to have set
Release VP IP= Y ?

I have done nothing but follow the install instructions for consolewd. I am not an expert on Linux so not sure how this should or should not be done.
I assume the comment you quoted needs to be put into the program itself, it is not something I can add?

Thanks

Tim

I was just wondering if you had that setting set in the config.txt file

I have not added this into the config file

here id the file I am usuing

Weather station type=32 // Irox=59,WMR100=232,WMR200=233,WMR300=235,WMR968=8,WMR918=3,WM918=1,Davis VP=31,Davis WMMII=4, WH1081=166,2310=60,WXT510=190,3600=61,Davis IP=32, OWWfile=71,universal=34,102=meteobridge,weatherflow=72,
rainwise cc-2000=20,cc-3000=21, Davis weatherlink.com=35,GW1000=103,WUAPI=104
meteobridge username=
meteobridge IP=192.168.110.22
meteobridge password=
Davis com method=2 //1 for serial, 2 for usb data logger
Davis timeout=0
OWW file location=
Davis VP IP port=22222 // Port for Davis VP IP data logger
Davis VP IP address=192.168.110.22 // IP address " " " " " "
GW1000 IP address=
wh1080 read delay=50
latitude= 37.2 /// latitude, e.g -38.375 for southern hemisphere
longitude= 122.08 /// e.g -175.456 for east of UTC/London
Station name=My station
clientrawlocation=
Start up daily rain(mm)=0.0
Start up monthly rain(mm)=0.0
Start up yearly rain(mm)=0.0
Do wunderground=N //For updating wunderground.com (set to Y for yes, N for no) (every 5 minutes)
Wunderground username=
Wunderground password=
Wunderground timezone=-8 // e.g 12 for 12 hours ahead of GMT, -12 for - 12 hours
timezone= (to change the local PC hour used)offset
Direction offset (whole degrees)=0
Barometer offset(hpa)=0
Comport number (e.g 1)=U //For non USB stations (e.g Davis, OS WMR968), use U for ttyUSB0 (i.e usb to serial)
Comport custom=
Davis com method=2 // 1 for regular 2 for special davis serial read
Revb Davis VP=Y (Y for Yes (new model (default) ) N for No)
Davis rain gauge=2 (1 for 0.1 inch, 2 for 0.01 inch, 3 for 0.2mm)
Do mysql=N //for mysql updates (see the readme for the table structure), every 5 minutes
Mysql username=
Mysql password=
Mysql server=
Mysql databasename=
Mysql tablename=
Mysql metric=Y (set N for oF, inches of rain, inches for baro)
Mysql time=300 (time interval between mysql update in seconds from 60 to 10000 sec)
Do CWOP updates=N //every 10 minutes
CWOP station id=
CWOP ham call sign=-1 // -1 is default (you do not have a Ham call sign)
CWOP Latitude=
CWOP Longitude=
Do clientraw FTP=N //(set to Y for yes, N for no), uploads every 1 minute
wmr200 data read delay=
FTP server=
FTP username=
FTP password=
FTP port=21 //default is 21
FTP remote dir=
FTP use passive=Y //(set to Y for yes, N for no)
FTP use remote file rename= //Write here the remote name: NOTE that not all FTP servers allow remote file rename"
FTP time interval=60 //the interval between two upload of the clientraw.txt and custom file
Save logfile=Y //to save the .txt logfile (set to N to save on disk space)
Logfile metric=N
Create custom file=N //converts the custom tags in a file called wxlocal.html to wx.html
Use this filename instead of wx.html=
Use this filename instead of wx2.html=
Use this filename instead of wx3.html=
Use this filename instead of wx4.html=
Use this filename instead of wx5.html=
FTP the custom file=N //will FTP the wx.html or filename you set to FTP server specified (clientraw FTP needs to be enabled too)
Units for custom tag file output:
Temp in celsius=N
Wind in=kts // options are: mph,kts,kph,m/s (changes the custom tags)
Baro in metric=N
Rain in metric=N
run cron files=Y // set to N to not run the separate cron files
do custom log=N // set to Y to create an appended logfile from a template (customlog.txt)
custom log out=customlogout.txt
temp offset= //C
hum offset=
wmr300 channel number=1
Rain Offset=0.0 //mm
Modified rain gauge=
update WOW= //Y or N
WOW id=
WOW pass=
update PWS= //Y or N
PWS id=
PWS pass=

Do windycom=N //For updating windy.com (set to Y for yes, N for no) (every 5 minutes)
windycom station #=
windycom API key=

create wxnow.txt= //Y or N
update windfinder=
windfinder id=
windfinder pass=
update meteotemplate= //Y or N
meteotemplatepass=
meteotemplateurl=
meteotemplatefast= //Y for 1 minute updates
meteotemplatefast2= //Y for every 30 seconds updates
universalupdaterate=2
Do weathercloud=N
weathercloud ID=
weathercloud KEY=

Send Email=
Send Email hour=
Email user=
Email pass=
Email server=
Email sendto=
Email from=
Email hour=
Email minute=

weatherlink.com DID=
weatherlink.com API=
weatherlink.com USR=
weatherlink.com PASS=

ultimeterrainmetric= /Y or N
ultimeterrain0.1inc= /Y or N 0.1 inch
ultimeterrain10= /Y or N 10x

Sorry, I’ve mislead you. I went to look at my config.txt to compare it with yours and I see that I’m using the meteobridge interface (type=102) rather than the VP2 Logger interface (type=32).

that linux lock seems to be related to a com port
but you have set to use an IP data logger
so that is something different

after how long running do you see the bad file number
as I will run a test here

I have made a change that might help
download a new update…

Brian,

That seems to work. It has now been running for 9 hours and still working. However, WDPI doesn’t seem to be displaying the results. The temperature on the left side seems to be correct, but the graphs are just straight lines

What units do you have set in the wdpi program?

mph, degrees F, inches, inches

I wonder if its a problem with those units in use
as a test try setting to use all metric selection?

mph, F , inches, inches

As another issue, I also have a gauge that I read from Weather Undergound. In the config file, I see where to put in username and password, but don’t see where to put the station ID and key.

How do I set this up to read from WeatherUnderground?

Try setting metric units in the WDpi program as
A test
It’s not clear to me what you are trying to achieve re the
Second Q

re the graph not updating in WDPi
try this:
quit consolewd
back up
then delete the files in the datafiles folder
then restart consolewd
then start WDpi
(and try running it from terminal as sudo ./wdpi

then wait a couple of minutes and then you should see the data

that should work (does here in testing)