Forum des Objets Communicants et Solutions pour les Libérer...
Vous souhaitez réagir à ce message ? Créez un compte en quelques clics ou connectez-vous pour continuer.

Forum des Objets Communicants et Solutions pour les Libérer...


 
AccueilAccueil  GalerieGalerie  RechercherRechercher  Dernières imagesDernières images  S'enregistrerS'enregistrer  Connexion  

 

 Nabaztag su MQTT (IoT)

Aller en bas 
2 participants
AuteurMessage
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeMer 1 Fév 2017 - 22:32

Ciao primi esperimenti su domotica e Nabaztag...

Per far diventare il coniglio una periferica per mqtt ho modificato il codice di boot
purtroppo quindi serve, almeno all'avvio, un server web dal quale fare caricare tale codice

io ho usato questo piccolo programma free
https://sourceforge.net/projects/miniweb/

copiate i files nella cartella radice del server (htdocs)

bc.jsp
macaddressconiglio.jsp   *vedi sotto

eseguite il programma miniweb.exe

entrate nella configurazione del coniglio e impostate come server l'indirizzo del vostro pc
per esempio (la porta di default di miniweb è la 8000)

http://192.168.1.10:8000

salvate e riavviate il coniglio

fatto
il vostro coniglio entrera' a far parte delle periferiche di casa!


*file di configurazione:

macaddressconiglio.jsp


campi separati da uno spazio

mqtt_broker nome del server broker con la porta di connessione ( https://www.cloudmqtt.com/ offre un servizio free o anche http://www.mqtt-dashboard.com/)
mqtt_user eventuale utente
mqtt_password eventuale password
mqtt_clientID nome del client mqtt deve essere unico per server (se non specificato usa il mac address del coniglio)
mqtt_topic topic dei comandi da inviare (se non specificato usa il mac address più /in: /123456789012/in)
mqtt_topic_out topic dei comandi che il coniglio invia (se non specificato usa il mac address più /out: /123456789012/out)
clock 1 attiva orologio (segnala ad ogni ora) - 0 niente orologio
alarm 1 attiva la sveglia - 0 sveglia non attiva
clock_msg specifica il messaggio per ogni ora (se non specificato emette un suono)
tts_url indirizzo per trasformare testo in mp3 (es: http://www.voicerss.org/ offre un servizio gratuito bisogna registrarsi e inserire la key e gli altri parametri nell'url)
alarm_msg messaggio della sveglia (se non specificato emette un suono)
time_clock imposta ora formato hhmmss ora minuti secondi senza spazi (se non specificato inizia dalle 000000 dal boot)
alarm_clock imposta sveglia hhmmss
sleep_clock imposta l'ora della nanna hhmmss
wakeup_clock imposta l'ora della sveglia hhmmss


esempio: 123456789012.jsp

mqtt_broker m10.cloudmqtt.com:19129
mqtt_user donald
mqtt_password duck
clock 1
alarm 1
clock_msg MSG=IT+IS+
tts_url http://api.voicerss.org/?key=xxxxxxxxxxxxx&r=-3&hl=en-gb&f=16khz_8bit_stereo&src=
alarm_msg MSG=Remember+you+have+to+go+to+work;
time_clock TIME=193500
alarm_clock ALARMCLOCK=115700
sleep_clock SLEEPTIME=210000
wakeup_clock WAKEUPTIME=083000

ricordatevi di personalizzare la lingua nel tts_url

varie:

comandi inviabili tramite client mqtt al topic (per esempio) /123456789012/in

EARS;R=1;L=2; (muove le orecchie right di 1 e left di 1)
TIME=100000 (imposta l'orologio alle 10 00 00)
SLEEPTIME=201200 (imposta l'ora per andare a letto alle 20 12 00)
WAKEUPTIME=080200 (imposta l'ora in cui si sveglia alle 08 02 00)
ALLARMCLOCK=130000 (imposta l'ora della sveglia alle 13 00 00)
AMSG=MSG=YUPPY! (imposta il messaggio da inviare per la sveglia)
RD=http://str01.fluidstream.net:7020; (attiva la radio dal sito)
MSG=BLABLABLA (dice blablabla)
MP3=http://miosito.com/x.mp3 (suona il brano mp3 dal sito)
BOOT; (esegue il pacchetto di boot .. reset)
WAKEUP; (alzati!)
SLEEP; (dormi!)
TAICHI=255 (imposta la frequenza del taichi da 0=niente a 255=molto)
RAW=0000 (pacchetto grezzo vedi *)
BREATH=5 (colore respirazione da 0 a 7)
NOSE=0 (lampeggio naso 0 no 1 un lampeggio 2 doppio lampeggio)

* documentazione in progress

i files sono scaricabili qui:
https://github.com/ccarlo64/nab_mqtt

prima versione..

Ciao
Carlo
Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeVen 3 Fév 2017 - 9:03

versione 2
aggiunte delle opzioni nel file di configurazione

b1_topic (topic per quando si preme il bottone, 1 click)
b1_msg (messaggio per quando si preme il bottone, 1 click)
b2_topic (topic per quando si preme il bottone, 2 click)
b2_msg (messaggio per quando si preme il bottone, 2 click)
ears_topic (topic per quando si muovono le orecchie)
ears_msg (messaggio per quando si muovono le orecchie)
rfid1 (codice rfid)
rfid1_topic (topic per quando annusa rfid1)
rfid1_msg (messaggio per quando annusa rfid1)


qualche esempio
opzioni per radiosveglia alle 7!

alarm 1
alarm_msg RD=http://str01.fluidstream.net:7020;
alarm_clock ALARMCLOCK=070000

opzioni per compagni di orecchie
ears_topic /macdelconigliocompagno/in


opzione per rfid

rfid1 012345678d87d
rfid1_msg MSG=Ho+annusato+le+chiavi+di+casa;

i codici rfid si possono ricavare cosi
fate annusare e di default inviera' il codice a /macaddressconiglio/out


opzioni bottoni
di default inviera' il numero di click a /macaddressconiglio/out
1 o 2 ..

Ciao
Carlo
Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeLun 6 Fév 2017 - 22:08

Qualche esperimento con dei sensori
luce e prossimità

Ciao
Carlo

Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeSam 11 Fév 2017 - 11:41

qualche aggiornamento

aggiunto il server ntp (solo ip non nome host), al boot si imposta l'ora da solo
specificare i parametri server timezone e segno timezone + o -

ntp_server 91.201.56.201
tmz 1
tms +

aggiunto il parametro ojn_url per poter mandare comandi violet ad un altro coniglio collegato al server openjabnab
il parametro si imposta per la parte fissa: server, macaddress e token e con
il comando public sul topic del coniglio si spedisce il resto
es:
su /topic/in
inviare OJN=tts=Buongiono+sono+io

ho aggiunto il parametro mqtt_port per integrarsi meglio con il boot originale

ho aggiunto il comando
TIME?
che dice ora minuti e secondi attuali

Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeJeu 23 Fév 2017 - 20:22

Ciao
ho configurato un server per fare prove
http://carcar.altervista.org/
spero si capisca!  nabzdrunk

Carlo
Revenir en haut Aller en bas
tikismoke
Bronze Nabz
Bronze Nabz
tikismoke


Localisation : Pays de la moutarde
Nabaztag : Nabaztiki
Nbr de messages : 299
Carottes : 6362

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeVen 24 Fév 2017 - 22:43

Hi Carlo any chance to have this translate to English ? I'm interesting to use mosquito mqtt but not know what's this about.
Revenir en haut Aller en bas
http://palmattitude.com
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeDim 26 Fév 2017 - 9:28

Hi Tikismoke!
my English is google.. :-) but I will try

if:

your bunny macaddress is: 12ab23bab23ba
your pc ip is: 192.168.2.5

donwload mosquitto https://mosquitto.org/download/ install and run
your server broker will be 192.168.2.5:1883

download web server https://sourceforge.net/projects/miniweb/ and run
your server www will be 192.168.2.5:8000

download boot code https://github.com/ccarlo64/nab_mqtt/tree/master/bin_v4/bc.jsp and copy it into
folder ..miniweb\htdocs

ok create a txt file for bunny config like this

ping 192.168.2.5
mqtt_broker 192.168.2.5:1883
mqtt_port 1883
clock 1
alarm 0
clock_msg MSG=The+Times+is+
tts_url http://api.voicerss.org/?key=xxxxxxxxxx8&r=0&hl=it-it&f=44khz_16bit_stereo&src=
alarm_clock ALARMCLOCK=180200
sleep_clock SLEEPTIME=220100
wakeup_clock WAKEUPTIME=082000
ntp_server 91.201.56.201
tmz 1
tms +


(personalize your tts_url, language and key of voicerss.org)
(personalize your timezone and timesign +1 in the example)
save as name 12ab23bab23ba.jsp and copy into folder ..miniweb\htdocs

ok
enter in configuration of your  bunny and set url config with
http://192.168.2.5:8000

done

restart nabaztag!  nabzjump

for test
install in your phone mymqtt
setting server 192.168.2.5 port 1883 no user and password
add subscrition use # like topic for view all

click button head of bunny .. a notification beep with 1 in client..

in client publish at topic /12ab23bab23ba/in the text BREATH=3
and your nabaz will change color

when I have more time I translate also the various commands

sorry for mistakes!!  nabzdrunk
Carlo
Revenir en haut Aller en bas
tikismoke
Bronze Nabz
Bronze Nabz
tikismoke


Localisation : Pays de la moutarde
Nabaztag : Nabaztiki
Nbr de messages : 299
Carottes : 6362

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeDim 26 Fév 2017 - 10:57

OK thank's it confirms my thought . You create a mqtt client for the tag, that's interesting. Will have a look in next weeks.

It could make nabaztag easier to integrate in home automation systems.
Revenir en haut Aller en bas
http://palmattitude.com
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeLun 6 Mar 2017 - 20:17

I try to translate in English

for boot version 5
config parameters


pingip where send record file
mqtt_portport server broker
mqtt_brokerserver broker with port
mqtt_useruser server broker
mqtt_passwordpassword server broker
mqtt_clientIDunique client mqtt name (default mac address)
mqtt_topictopic input (default macaddress + /in)
mqtt_topic_outtopic output (default macaddress + /out)
clock1 clock enabled 0 clock disabled
alarm1 alarm enabled 0 alarm disabled
clock_msgmsg for clock hour
tts_urlurl for tts
alarm_msgmsg for alarm
time_clockset time clock
alarm_clockset alarm clock
sleep_clockset sleep clock
wakeup_clockset wakeup clock
ojn_urlurl server ojn + parameters
ntp_serverip server ntp
tmznumber timezone
tms sign+/- timezone
b1_topictopic for 1 click button
b1_msgmsg for 1 click button
b2_topictopic for 2 click button
b2_msgmsg for 2 click button
ears_topictopic for ears move
ears_msgmsg for ears move
rfidlist of codes rfid separated by the character $
rfid_topiclist of topic separated by the character $
rfid_msglist of msg separated by the character $
rss1url for rss
rrs1titlenumber of titles to be read
monthlist of month name separated by the character $
mqtt_will_topictestament topic
mqtt_will_msgtestament message
example file
123456789012.jsp

ping 192.168.2.5
mqtt_broker 192.168.2.5:1883
mqtt_port 1883
clock 1
alarm 0
clock_msg MSG=It+is+
tts_url http://api.voicerss.org/?key=00000000000000000000000000000000&r=0&hl=en-gb&f=44khz_16bit_stereo&src=
alarm_clock ALARMCLOCK=180200
sleep_clock SLEEPTIME=2201000
wakeup_clock WAKEUPTIME=065800
ntp_server 91.201.56.201
tmz 1
tms +
month January$February$March$April$May$June$July$August$September$October$November$December
rss1 http://www.ansa.it/sito/notizie/politica/politica_rss.xml
rss1title 4
rfid d00218c1090b1230$d0021a0352c14123$d00218c123163e94$d00123c109163a2b
rfid_topic /123456789012/in$/123456789012/in$/123456789012/in$/123456789012/in
rfid_msg MSG=Bunny+green$MSG=Bunny+dark+green$MSG=Stamp+red$MSG=Stamp+yellow
mqtt_will_topic /info
mqtt_will_msg offline



commands sent via mqtt topic /123456789012/in

EARS;R=1;L=2; (move ears right 1 and left 1)
ALLARMCLOCK=130000 (set alarm clock 13 00 00)
AMSG=MSG=YUPPY! (set message for alarm)
RD=http://str01.fluidstream.net:7020; (enable stream radio from url)
MSG=Blabla (say blabla)
MP3=http://192.168.2.5/x.mp3 (play mp3 from url)
BOOT; (reset led and ears)
WAKEUP;
SLEEP;
TAICHI=255 (set taichi frequency  0=nothing  255=often)
RAW=0000 (*)
BREATH=5 (breath color 0-7)
NOSE=0 (nose blink 0, 1 blink, 2 blink)
TIME? say hour minuts seconds
DATE? say day month year
OJN=tts=Blabla send to ojn server the command violet for tts
RSS1; read rss1 stream
RSS1TITLE=2 set 2 title to read from rrs
TEST=1 emulates 1,2 or 3 physical click (3 is for record voice)

* RAW Values

like the original nabaztag:

Service_Weather
010x Weather_Sun = 0, Weather_Cloudy = 1, Weather_Smog = 2, Weather_Rain = 3, Weather_Snow = 4, Weather_Storm = 5

Service_StockMarket
020x StockMarket_HighDown = 0, StockMarket_MediumDown = 1, StockMarket_LittleDown = 2, StockMarket_Stable = 3, StockMarket_LittleUp = 4, StockMarket_MediumUp = 5, StockMarket_HighUp = 5

Service_Periph
030x Periph_VeryLow = 0, Periph_Low = 1, Periph_LowAverage = 2, Periph_Average = 3, FastAverage = 4, Fast = 5, VeryFast =6

Service_EMail
040x EMail_No = 0, EMail_1 = 1, EMail_2 = 2, EMail_3AndMore = 3

Service_AirQuality
050x AirQuality_Good = 0, AirQuality_Medium = 5, AirQuality_Bad = 10

000x disable service x.. 1, 2, 3, 4, 5
Revenir en haut Aller en bas
tikismoke
Bronze Nabz
Bronze Nabz
tikismoke


Localisation : Pays de la moutarde
Nabaztag : Nabaztiki
Nbr de messages : 299
Carottes : 6362

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeMar 7 Mar 2017 - 7:30

Very very nice. I'll try it ASAP as I have time too.
Revenir en haut Aller en bas
http://palmattitude.com
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3587

Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitimeSam 11 Mar 2017 - 10:33

aggiornamento versione 6
aggiunti parametri nel config

mqtt_conn_topic topic ove inviare un messaggio alla connessione al server
mqtt_conn_msg contenuto del messaggio
parameters default 110001-000-0-0  

vedi sotto il dettaglio
per esempio
parameters 110011-000-0-1  
(mqtt broker con utente e password e flag clean e will messagio e messaggio alla connessione)

nuovo comando sempre da mandare al topic /123456789012/in  
REBOOT;
che effettua un reboot del nab

config nuove parti esempio
...
mqtt_will_topic /info
mqtt_will_msg Bunnyoffline
mqtt_conn_topic /info
mqtt_conn_msg Bunnyonline
parameters 110011-000-0-1



Ciao
Carlo
----

update  
for boot version 6  
add for config file  
 
mqtt_conn_topic on connect topic  
mqtt_conn_msg on connect message  
parameters default 110001-000-0-0  
 

// ****   explain  
//  parameters  110011-000-0-1  
//              !!!!!! !!! ! !____ msg on connect 0 or 1  
//              !!!!!! !!! !____ QoS on SUBSCRIBE 0 1 or 2  
//              !!!!!! !!!____ dup on PUBLISH 0 or 1  
//              !!!!!! !!____ QoS on PUBLISH 0 1 or 2  
//              !!!!!! !____ retain on PUBLISH 0 or 1      
//              !!!!!!____________________ clean on CONNECT 0 or 1  
//              !!!!!_____________ will flag on CONNECT 0 or 1  
//              !!!!___________ will QoS on CONNECT 0 1 or 2  
//              !!!_________ will retain on CONNECT 0 or 1  
//              !!_______ password on CONNECT 0 or 1  
//              !____ user on CONNECT 0 or 1  

example  
parameters 110011-000-0-1  
(mqtt broker with user and password with clean on CONNECT and will message and msg on connect)  
 
new commands sent via mqtt topic /123456789012/in  
REBOOT; for reset bunny


config new example
...
mqtt_will_topic /info
mqtt_will_msg Bunnyoffline
mqtt_conn_topic /info
mqtt_conn_msg Bunnyonline
parameters 110011-000-0-1
Revenir en haut Aller en bas
Contenu sponsorisé





Nabaztag su MQTT (IoT) Empty
MessageSujet: Re: Nabaztag su MQTT (IoT)   Nabaztag su MQTT (IoT) Icon_minitime

Revenir en haut Aller en bas
 
Nabaztag su MQTT (IoT)
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» Nabaztag et MQTT
» Impossible de s'enregistrer sur http://www.nabaztag.com ? + Nabaztag V2 compatible ?
» Nabaztag orphanage opens / L'orphelinat de Nabaztag s'ouvre
» [Idée à approfondir] Serveur privé Nabaztag (Mon-Nabaztag.fr)
» Passer du Nabaztag au Nabaztag-tag : nouvel abonnement ?

Permission de ce forum:Vous ne pouvez pas répondre aux sujets dans ce forum
Forum des Objets Communicants et Solutions pour les Libérer... :: IV. I Don't Speak French! :: Save Nabztag : Alternative Solutions-
Sauter vers: