Git Product home page Git Product logo

swpi's Issues

Checksum calculation fails on overflow

Your checksumCalc variable can overflow. You need to mask it with 0x0f otherwise the checksum comparison will fail eventhough it matches.

unsigned int checksumCalc = 0;
checksumCalc += (winddir & 0x0f);
checksumCalc += ((windspeed >> 8) & 0x0f);
checksumCalc += ((windspeed >> 4) & 0x0f);
checksumCalc += (windspeed & 0x0f);

You need to add:

checksumCalc &= 0x0f;

Sint wind in APRS

Correggere TTLib.py per un corretto aggiornamento dati "umidità" e pioggia in APRS; le correzioni da apportare sono:

humidity

if (globalvars.meteo_data.hum_out != None):
    rh = float(globalvars.meteo_data.hum_out / 100 )
    if rh >= 0.995:
        humid_str = "h00"
    else:

humid_str = "h" + "%02.0f" % (rh * 100.0)

        humid_str = "h" + "%02.0f" % (globalvars.meteo_data.hum_out)
    send += humid_str

rain last hour -- each count is 0.0204"

if (globalvars.meteo_data.rain_rate_1h != None):
    rain_hr_hundredth_inches = float(globalvars.meteo_data.rain_rate_1h * 3.9370078)
    rain_hr_str = "r" + "%03d" % rain_hr_hundredth_inches

rain_hr_str = "r" + int(globalvars.meteo_data.rain_rate_1h)

    send += rain_hr_str

# rain last 24 hours -- each count is 0.0204"
# so the math accidentally scales perfect -- report in hundreths of inches
if (globalvars.meteo_data.rain_rate_24h != None) :
    rain_24_hrs_hundredth_inches = float(globalvars.meteo_data.rain_rate_24h * 3.9370078)
    rain_24_hrs_str = "p" + "%03d" % rain_24_hrs_hundredth_inches

rain_24_hrs_str = "p" + int(globalvars.meteo_data.rain_rate_24h)

    send += rain_24_hrs_str

skip rain since midnight

if (globalvars.meteo_data.rain_rate != None ) :
    rain_today_hundredth_inches = float(globalvars.meteo_data.rain_rate  * 3.9370078)
    rain_midnight_str = "P" + "%03d" % rain_today_hundredth_inches
    send += rain_midnight_str

invalid wind speed

Hello,

I connect a TX23 Wind Sensor to Raspberry (latest Rasbian) and use your code to get data.
Next to the Sensor I placed a small Fan to get stable wind speed and fixed the direction sensor to
have always the same value for testing.

When i try to use ./readTX23 -v i get data like followed (try differend times over a time of lets say 10 minutes?)

root@raspberrypi:/home/wetter/swpi/TX23# ./readTX23 -v

Bit Length: 1225 uSec
Start frame: 27
Wind Direction: W (12)
Wind Direction2: W (12)
Wind Speed: 7
Wind Speed2: 7
Checksum (received): 3
Checksum (calculated): 19

Data is NOT Valid!

root@raspberrypi:/home/wetter/swpi/TX23# ./readTX23 -v

Bit Length: 1225 uSec
Start frame: 27
Wind Direction: W (12)
Wind Direction2: W (12)
Wind Speed: 8
Wind Speed2: 8
Checksum (received): 4
Checksum (calculated): 20

Data is NOT Valid!

root@raspberrypi:/home/wetter/swpi/TX23# ./readTX23 -v

Bit Length: 1225 uSec
Start frame: 27
Wind Direction: W (12)
Wind Direction2: W (12)
Wind Speed: 9
Wind Speed2: 9
Checksum (received): 5
Checksum (calculated): 21

Data is NOT Valid!

root@raspberrypi:/home/wetter/swpi/TX23# ./readTX23 -v

Bit Length: 1225 uSec
Start frame: 27
Wind Direction: W (12)
Wind Direction2: W (12)
Wind Speed: 9
Wind Speed2: 9
Checksum (received): 5
Checksum (calculated): 21

Data is NOT Valid!

root@raspberrypi:/home/wetter/swpi/TX23# ./readTX23 -v

Bit Length: 1225 uSec
Start frame: 27
Wind Direction: W (12)
Wind Direction2: W (12)
Wind Speed: 9
Wind Speed2: 9
Checksum (received): 5
Checksum (calculated): 21

Data is NOT Valid!

First of all whats the messure of wind speed?
If it is m/s why it is an integer?
Why i get always the same discalculated checksum?
I overclock my raspberry I don't know if it is a problem for this code (e.g. the timer)?

I'am an bloody beginer @hardware codeing.
I also ask the author of source code but he didn't answer so I hope you can please help me.
Thanks a lot.

ImportError: No module named Image

Hi Tonino,
thanks for making this huge program available.
i want to use this program with my La Crosse TX-23U device.

i am getting this error message after runnning:
sudo python swpi.py

File "/home/pi/swpi-master/TTLib.py", line 15, in
import Image
ImportError: No module named Image

where is Image.py located ???

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.