report RFD900 packets received as well as link margin estimate.

(non-zero packets received implies radio link).
This commit is contained in:
gardners 2013-07-19 10:30:54 +09:30
parent 2c1a995275
commit 8968d5cf05
3 changed files with 10 additions and 7 deletions

View File

@ -549,9 +549,9 @@ int rhizome_server_parse_http_request(rhizome_http_request *r)
r->request_type = RHIZOME_HTTP_REQUEST_FROMBUFFER;
char temp[8192];
snprintf(temp,8192,
";%lld;%d;%d;%d;%d;%s;%d;%d;%d;%d;%d\n",
";%lld;%d;%d;%d;%d;%d;%s;%d;%d;%d;%d;%d\n",
gettime_ms(),
last_radio_rssi,last_radio_temperature,
last_radio_rssi,last_radio_temperature,last_radio_rxpackets,
(int)bundles_available,
rhizome_active_fetch_count(),
alloca_tohex(my_subscriber->sid, 8),
@ -567,13 +567,13 @@ int rhizome_server_parse_http_request(rhizome_http_request *r)
char temp[8192];
snprintf(temp,8192,
"<html><head><meta http-equiv=\"refresh\" content=\"5\" >"
"</head><body><h1>Radio link margin = %+ddB<br>"
"</head><body><h1>Radio link margin = %+ddB (%d packets received)<br>"
"Radio temperature = %d&deg;C<br>"
"SID: %s*<br>"
"%d rhizome bundles in database<br>"
"%d rhizome transfers in progress<br>(%d,%d,%d,%d,%d bytes)<br>"
"</h1></body></html>\n",
last_radio_rssi,last_radio_temperature,
last_radio_rssi,last_radio_rxpackets,last_radio_temperature,
alloca_tohex(my_subscriber->sid, 8),
(int)bundles_available,
rhizome_active_fetch_count(),

View File

@ -810,6 +810,7 @@ uint32_t Crc32_ComputeBuf( uint32_t inCrc32, const void *buf,
size_t bufLen );
extern int last_radio_rssi;
extern int last_radio_temperature;
extern int last_radio_rxpackets;
int rhizome_active_fetch_count();
int rhizome_active_fetch_bytes_received(int q);
extern int64_t bundles_available;

8
slip.c
View File

@ -152,19 +152,21 @@ int slip_encode(int format,
unsigned long long last_rssi_time=0;
int last_radio_rssi=-999;
int last_radio_temperature=-999;
int last_radio_rxpackets=0;
int parse_rfd900_rssi(char *s)
{
int lrssi,rrssi,lnoise,rnoise,temp;
int lrssi,rrssi,lnoise,rnoise,rxpackets,temp;
// L/R RSSI: 48/0 L/R noise: 62/0 pkts: 0 txe=0 rxe=0 stx=0 srx=0 ecc=0/0 temp=21 dco=0
if (sscanf(s,"L/R RSSI: %d/%d L/R noise: %d/%d pkts: %*d txe=%*d rxe=%*d stx=%*d srx=%*d ecc=%*d/%*d temp=%d dco=%*d",
&lrssi,&rrssi,&lnoise,&rnoise,&temp)==5)
if (sscanf(s,"L/R RSSI: %d/%d L/R noise: %d/%d pkts: %d txe=%*d rxe=%*d stx=%*d srx=%*d ecc=%*d/%*d temp=%d dco=%*d",
&lrssi,&rrssi,&lnoise,&rnoise,&rxpackets, &temp)==5)
{
int lmargin=(lrssi-lnoise)/1.9;
int rmargin=(lrssi-lnoise)/1.9;
int maxmargin=lmargin; if (rmargin>maxmargin) maxmargin=rmargin;
last_radio_rssi=maxmargin;
last_radio_temperature=temp;
last_radio_rxpackets=rxpackets;
if (config.debug.packetradio||(gettime_ms()-last_rssi_time>30000)) {
INFOF("Link budget = %+ddB, temperature=%dC",maxmargin,temp);