× Benvenuti sul nostro forum su Sint Wind PI!

Postate qui domande o segnalate problemi / bug che riscontrate,

map-pin SWPI Plugins

More
11 years 1 week ago #1402 by tony
Replied by tony on topic SWPI Plugins
è presente la urlib2 e urllib ma te le sconsiglio perché mi hanno dato innumerevoli problemi di stabilità. Utilizza invece la request

Please Log in to join the conversation.

More
10 years 9 months ago #2066 by zonton
Replied by zonton on topic SWPI Plugins
Scusate se rompo.....in programmazione sono sottozero :( :oops:

Sto provando ad usare AllLogger ma non essendo registrato su WeatherUnderground nel log esce un errore:

(Log to Wunderground : INVALIDPASSWORDID|Password and/or id are incorrect)

il meteo.txt viene inviato e tutto funzione regolarmente.
Cosa dovrei eliminare/modificare per evitare l'errore ?


def run(self):
log("Starting plugin : %s" % sys.modules[__name__])
while 1:
###################### Plugin run
time.sleep(60-datetime.datetime.now().second)
if ( globalvars.meteo_data.status == 0 ):
logDataToWunderground(self.cfg.WeatherUnderground_ID,self.cfg.WeatherUnderground_password)
UploadData(self.cfg)
logData(self.cfg.serverfile,self.cfg.SMSPwd)
###################### end of Plugin run

Please Log in to join the conversation.

More
10 years 9 months ago #2068 by roberto2011
Replied by roberto2011 on topic SWPI Plugins
nella configurazione swpi.cfg c'e' gia il false?

[WeatherUnderground]
weatherunderground_logdata = False

Sensori Davis +BME280 + Raspberry b+ webCam serrasanta.fleanet.it (Eremo di Serrasanta - Gualdo Tadino - 1.340 m s.l.m.)

Please Log in to join the conversation.

More
10 years 9 months ago #2069 by zonton
Replied by zonton on topic SWPI Plugins
Si ho ricontrollato ora è False.
Probabilmente il plugin non lo considera.

Please Log in to join the conversation.

More
10 years 9 months ago #2070 by roberto2011
Replied by roberto2011 on topic SWPI Plugins
si ho visto
prova questo !

Attachment AllLogger.zip not found


Sensori Davis +BME280 + Raspberry b+ webCam serrasanta.fleanet.it (Eremo di Serrasanta - Gualdo Tadino - 1.340 m s.l.m.)
Attachments:

Please Log in to join the conversation.

More
10 years 9 months ago #2071 by zonton
Replied by zonton on topic SWPI Plugins
Provato ma esce a video questo:

Exception in thread thread-7:
file "/usr/lib/python2.4/threading.py", line 552, in _bootstrap_inner
self.run()
file "./plugins/AllLogger.py" , line 48, in run
if (cfg.WeatherUnderground_logdata ) :
NameError : global name 'cfg' is not defined

Spero di aver copiato giusto dal video , sul log non risulta

grazie...

Please Log in to join the conversation.

More
10 years 9 months ago #2072 by roberto2011
Replied by roberto2011 on topic SWPI Plugins
mi è sfuggito un self.

if (self.cfg.WeatherUnderground_logdata):

Sensori Davis +BME280 + Raspberry b+ webCam serrasanta.fleanet.it (Eremo di Serrasanta - Gualdo Tadino - 1.340 m s.l.m.)
The following user(s) said Thank You: zonton

Please Log in to join the conversation.

More
10 years 9 months ago #2073 by zonton
Replied by zonton on topic SWPI Plugins
Ottimo , ora tutto ok

Grazie 1000

Please Log in to join the conversation.

  • antosere10
  • antosere10's Avatar
  • Visitor
  • Visitor
10 years 4 months ago #3813 by antosere10
Replied by antosere10 on topic SWPI Plugins
scusate ragazzi la mia ignoranza sto smanettando per la prima volta sul raspberry e ho messo questo firmware spettacolare di toni, ma mi sto perdendo, potreste cortesemente indicarmi dove devo inserire l'ID e la PAssword di wunderground?
ve ne sarei molto grato

Please Log in to join the conversation.

More
10 years 4 months ago #3817 by tony
Replied by tony on topic SWPI Plugins
c'è una sezione dedicata a wunderground nel file di configurazione. I nomi delle chiavi mi sembrano molto comprensibili.

Please Log in to join the conversation.

  • antosere10
  • antosere10's Avatar
  • Visitor
  • Visitor
10 years 4 months ago #3818 by antosere10
Replied by antosere10 on topic SWPI Plugins
Piacerissimo di conoscerti Tony hai ragione poi dopo un po' di ammanettamento ci sono riuscito ora ho alcune discordanze con LCD della stazione e quello che mi riporta wunderground e non so Da cosa possa dipendere

Please Log in to join the conversation.

More
9 years 7 months ago - 9 years 6 months ago #4833 by ciapa85
Replied by ciapa85 on topic SWPI Plugins
Sono riuscito a modificare AllLogger per far inviare i dati ogni minuto oltre che a wudergrond anche a PWS;
non riesco a farli inviare a CWOP. ho provato ad aggiungere questa stringa ma mi da un errore
logDataToCWOP(self.cfg.CWOP_ID,self.cfg.CWOP_password)

la sintassi è giusta?
la password di CWOP non mi è stata ancora data, e ho lasciato quella di default sul SWPI.

grazie a presto
Last edit: 9 years 6 months ago by ciapa85. Reason: ho risolto parzialmente il problema

Please Log in to join the conversation.

More
6 years 3 months ago #8182 by SkizZO
Replied by SkizZO on topic SWPI Plugins
Salve a tutti, sto scrivendo qua e la sul forum perchè ho parechcie cose che bollono in pentola...

Sto cercando di costruire un plugin di supporto al bot di telegram, che avvisa dei cambiamenti (a me interessa il vento)... in realtà per me sarebbe mooolto più semplice se in php o jscript.. ma ahimè sto scazzottando con python (sono autodidatta 100%).

Premessa fatta lo script funziona, ma devo fare in modo che non sia molesto. Per questo mi serve una variabile globale che memorizza il numero di letture fuori specifica. E' gestita da swpi nel plugin sincrono?.. sto avendo problemi con questo script:
if globalvars.meteo_data.wind_ave < 1:  #speedalert var
           numwindup = 0
        elif numwindup <= 2: #countalert var 
           numwindup = numwindup + 1
        else:
           bot.sendMessage(gruppotelegram, text='La velocita del vento ha superato i 12 nodi, corri in spiaggia!!!')

ovviamente lanciando lo script con sudo python non da errore, numwindup l'ho dichiarata sia all'inizio del file, che nella plugin initialization zone.

l'errore di swpi è il seguente:

Traceback (most recent call last):
  File "swpi.py", line 941, in <module>
    [29/03/2018-16:37:59] Starting plugin : <module 'SWPIBot_ITA' from './plugins/SWPIBot_ITA.pyc'>
pl.loadAll()
  File "/swpi/pluginmanager.py", line 34, in loadAll
    swpi_plugin_Thread = mod.swpi_plugin(self.cfg)
AttributeError: 'module' object has no attribute 'swpi_plugin'


..l'errore non è relativo al mio plugin, ma sicuro dipende da qualche mio errore

Please Log in to join the conversation.

More
6 years 3 months ago #8183 by roberto2011
Replied by roberto2011 on topic SWPI Plugins
Puoi creare un bot anche in PHP . Su web trovi diverse guide.
Esiste poi la funzione inline per fare delle query dai gruppi (cosa che avevi chiesto su un altro post)

Sensori Davis +BME280 + Raspberry b+ webCam serrasanta.fleanet.it (Eremo di Serrasanta - Gualdo Tadino - 1.340 m s.l.m.)

Please Log in to join the conversation.

More
6 years 3 months ago - 6 years 3 months ago #8184 by SkizZO
Replied by SkizZO on topic SWPI Plugins
...al momento mi serve il plugin in python perchè swpi deve caricarlo ad ogni ciclo.

Se dichiaro una variabile all'inizio, la mantiene? non credo di doverla dichiarare in init plugin, perchè è una funzione...

Edit: ho appurato che il problema è nelle variabili che non vengono mantenute. Dove posso dichiarare una variabile globale nel plugin SINCRONO ?

..in quello asincrono tutto funziona.
Last edit: 6 years 3 months ago by SkizZO.

Please Log in to join the conversation.

More
6 years 3 months ago #8185 by SkizZO
Replied by SkizZO on topic SWPI Plugins
...mi rispondo da solo (per i posteri)

- Degli errori erano dovuti al fatto che avevo RINOMINATO il plugin sincrono... da NON fare.
- Le variabili globali vanno GIUSTAMENTE dichiarate all'estrno della funzione (inizializzate), ma nella funzione bisogna dichiararle globali:
global nomevar

...se non si dichiara, ne crea un'altra locale.. (booh! però funziona)

..Lo script l'ho quasi terminato, devo studiare come confrontare un array (di stringhe) con una variabile (per la direzione del vento, visto che in gradi dà solo la media giornaliera (globalvariables.meteo_data_wind_dir_ave è numerico(ma AVE è una media), e wind_dir è testuale)

Please Log in to join the conversation.

Time to create page: 0.828 seconds