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  
Le Deal du moment :
Funko POP! Jumbo One Piece Kaido Dragon Form : ...
Voir le deal

 

 free mother

Aller en bas 
3 participants
AuteurMessage
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: free mother   free mother Icon_minitimeMar 27 Mar 2018 - 19:14

Hi,
since I can not connect my mother to the site sen.se and the media does not respond to my emails ..

we will create our own server or at least we will try ..

is very little about this argument, so any information is welcome!

necessary
free mother Immagi11


a linux pc (a raspberry with raspbian is fine)
we assume the name of the ethernet card is eth0

install the dnsmasq package (for dhcp and dns)
apt-get install dnasmasq

we configure /etc/dnsmasq.conf

# global options
domain-needed
bogus-priv
no-resolv
filterwin2k
expand-hosts
domain = mydomain.net
local = /mydomain.net/
listen-address = 127.0.0.1
listen-address = 192.168.0.1

# DHCP range
dhcp-range = eth0,192.168.0.10,192.168.0.50,12h



we assign the ip to the network card (eth0) where we connected Mother
ifconfig eth0 192.168.0.1 netmask 255.255.255.0



add these lines to the /etc/hosts file
192.168.0.1 in.sen.se
192.168.0.1 pool.ntp.org


we modify /etc/ntp.conf to read the time from the pc clock

we add

server 127.127.1.0
fudge 127.127.1.0 stratum 10

and comment on the lines of 'pool'



----
for the server part I used https://github.com/Pithikos/python-websocket-server (thanks Pithikos!)

follow the installation instructions (python setup.py install)

copy the modified server program freemother.py

https://github.com/ccarlo64/freemother


please edit the file and set mac address variable (check it in you router)
compose with "MO" + MACADDRESS without ":"
like this
mac='MO0004A3F90001' ###change here

same in the clienttest.html


run...
python freemother.py
free mother Log10

connect Mother and after a few seconds she will smile

To see the effects, in the same pc loaded in firefox the clienttest.html
free mother Client10

COOKIE:
the name of 4 cookies (node) are hex digit, plese analyze the log on server and change the file
this are mine

cookieNode=['6FEC200D','AA81082C','206B121A','65EB0E1C']

help me, please test!!!

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



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeJeu 5 Avr 2018 - 22:48

ver 1

Added a sqlite db to store sensor data and created a page to display data

free mother Scherm11
Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeVen 13 Avr 2018 - 18:58

added the management of the reset sounds and animations
(tap tap between the eyes when starting M.)

to work you need a web server
installed in the same pc for example

apt-get install webfs
create the / var / www / html folder and copy it into the two folders

00102
is
00103

containing the files

default webfs is activated on localhost: 8000
that should be 192.168.0.1 following my example

the sounds are mono wav files sampled at 16k I do not know the limits of M.
the animations are described in the json text files you have to go a little imagination and do tests

Carlo
Revenir en haut Aller en bas
luismo
Lapin nain
Lapin nain
luismo


Age : 54
Localisation : Geneve
Nabaztag : Karotz
Nbr de messages : 34
Carottes : 3036

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeMar 5 Juin 2018 - 13:14

Thank you very much for your work !
I will try it as soon as possible nabzcheers

edit 16.06.18:
trying to install python-websocket-server-master:
I need to add this command before running 'python setup.py install': sudo apt-get install python-setuptools

edit 17.06.18:
I connected my mother and she smile, but not for long time. After a few minutes I have that: sorry for the poor quality:
free mother 20180610

And the cookies does not appears like in your example
Revenir en haut Aller en bas
DragoVaillant
Lapin nain
Lapin nain



Localisation : France
Nbr de messages : 2
Carottes : 2071

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeJeu 13 Sep 2018 - 19:32

Hello,

Thank you for this great work.

I tested the software on my mother : the synchronization is going well and the data of the cookies are well received.

By cons, I have the same problem of disconnection as luismo.

Looking a little closer, it seems to happen after receiving a "time" request that is not processed by the python script.

As a workaround, I made a change to return an empty message (msgup style) and this seems to prevent disconnection.

Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeVen 14 Sep 2018 - 9:04

Hi,
sorry for the delay!
if you disconnect it is probably a problem in the ping part that should keep the connection alive.
It is possible that there is some unmanaged case! I'm sorry! :-)
If you pass me your information I try to implement them in the script.
Now I will do other tests.

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



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeVen 14 Sep 2018 - 20:18

Hi,
I tried to leave Mother connected several minutes, the connection does not fall, I do not understand
are you using version 11?

Carlo
Revenir en haut Aller en bas
DragoVaillant
Lapin nain
Lapin nain



Localisation : France
Nbr de messages : 2
Carottes : 2071

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeVen 14 Sep 2018 - 20:45

Hi,

Yes, I'm using the version 11.

This is a "time" command that reacts as a kind of keep-alive.

Here is the request :
{"resource" : "time", "method" : "get"}

I modified the script to add a response to this command.
I only send a msg up with no other information and then the connection doesn't fall down.


Revenir en haut Aller en bas
carlo64
Bronze Nabz
Bronze Nabz



Localisation : italia
Nbr de messages : 162
Carottes : 3608

free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitimeMar 21 Mai 2019 - 21:23

Hi,
Added the answer I 'believe' correct to {"resource" : "time", "method" : "get"}
now set the date to mother for events etc

an extract

Code:

---
# from datetime import datetime, timedelta
def totimestamp(dt, epoch=datetime.datetime(1970,1,1)):
   td = dt - epoch
   # return td.total_seconds()
   return (td.microseconds + (td.seconds + td.days * 86400) * 10**6) / 10**6

---
    #add 09-2018 and 05-2019
    if j['resource']=='time':
     if j['method']=='get':
       print "response at time get width time set...."
       # set time        utcnow()
       now = datetime.datetime.now()
       print now
       ntptime = totimestamp(now)        
       msgSetTime ='{"body": '+str(ntptime)+', "resource": "time", "method": "post" }'        
       server.send_message(client, msgSetTime)
       print "SRV: "+msgSetTime
       #server.send_message(client, msgup)
Revenir en haut Aller en bas
Contenu sponsorisé





free mother Empty
MessageSujet: Re: free mother   free mother Icon_minitime

Revenir en haut Aller en bas
 
free mother
Revenir en haut 
Page 1 sur 1
 Sujets similaires
-
» mother webserver
» mother disassembled
» Sense Mother: le nouveau gadget de Rafi Haladjian
» Sense Mother : une autre arnaque du même niveau que Nabaztag et Karotz ?
» free

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... :: III. Nouveaux Objets Communicants (NOC) :: Sense-
Sauter vers: