{"id":1160,"date":"2012-03-01T02:22:19","date_gmt":"2012-03-01T01:22:19","guid":{"rendered":"http:\/\/www.zigbe.net\/?p=1160"},"modified":"2016-02-26T02:10:11","modified_gmt":"2016-02-26T01:10:11","slug":"bmotesgateway-para-opendomo-la-inspiracion","status":"publish","type":"post","link":"https:\/\/blog.whatsbee.net\/?p=1160","title":{"rendered":"bMotesGateway for Opendomo; The inspiration   bMotesGateway para Opendomo, la inspiraci\u00f3n"},"content":{"rendered":"<p><!--:en--><\/p>\n<p style=\"text-align: justify;\">Following yesterday\u2019s post, the inspiration finally has arrived.<\/p>\n<p style=\"text-align: justify;\">The first problem was that the network didn\u2019t function with the Arduino Mega. The library I am using is one for the Arduino Xbee, and this library does not work if the nodes aren\u2019t configured to API enabled with escape sequences. Like everything in the world of Arduino, this symptom is completely esoteric (esta palabra existe en ingles, pero no lo se que significa!!) and doesn\u2019t track the problem. In this case, the node packets arrived to the coordinator filled with zeros.<\/p>\n<p style=\"text-align: justify;\">The second problem was it didn\u2019t work on the Arduino based on the 328 chip which was identified as a RAM problem. Whoever works with Arduino will know that when they go over the maximum capacity of the RAM, the symptoms are completely random and you cannot know how much ram will be consumed in any given moment.<\/p>\n<p style=\"text-align: justify;\">Today I decieded to try the sketch removing all of the extendable parts and the symptom changed. I loaded a function\/feature to view the memory in screen and I looked at several points where I thought it had failed. Indeed some of the free memory was zero.<\/p>\n<p style=\"text-align: justify;\">With the problem diagnosed, the tricky part was then to solve it. After more than 15 days testing the program it was not clear what functions I modified receiving the packet contents as a parameter, defining a single variable to the contents of the package in the sketch. After some problems, everything finally worked!<\/p>\n<p style=\"text-align: justify;\">What we haven\u2019t achieved yet is it working on the Xboard \u2018placa\u2019, which I already have the box for. So I mounted one on the Itead Studio ($29 with POE, Ethernet card and a SC). The shame is that it is slightly larger and doesn\u2019t come with a box, however as a very resourceful person (and a smoker!), I came up with this\u2026.<\/p>\n<div id=\"attachment_1161\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg\"><img aria-describedby=\"caption-attachment-1161\" loading=\"lazy\" class=\"size-full wp-image-1161\" title=\"gatewayOpendomo2\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg\" alt=\"\" width=\"500\" height=\"313\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg 500w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2-300x188.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-1161\" class=\"wp-caption-text\">bMotesGateway 1<\/p><\/div>\n<div id=\"attachment_1162\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg\"><img aria-describedby=\"caption-attachment-1162\" loading=\"lazy\" class=\"size-full wp-image-1162\" title=\"gatewayOpendomo1\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg\" alt=\"\" width=\"500\" height=\"452\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg 500w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1-300x271.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-1162\" class=\"wp-caption-text\">bMotesGateway 2<\/p><\/div>\n<p>The upside is tomorrow you can buy one of these boxes from your local&#8230;<\/p>\n<div id=\"attachment_1163\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg\"><img aria-describedby=\"caption-attachment-1163\" loading=\"lazy\" class=\"size-full wp-image-1163\" title=\"funda-paquete-tabaco-plastico-disponible-col\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg\" alt=\"\" width=\"600\" height=\"600\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg 600w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col-150x150.jpg 150w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col-300x300.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-1163\" class=\"wp-caption-text\">Cajas para paquetes de tabaco<\/p><\/div>\n<p><!--:--><!--:es-->Siguiendo con el post de ayer, la inspiraci\u00f3n finalmente ha llegado.<\/p>\n<p>El primer problema, la red no me funcionaba en el Arduino Mega, era evidente, no lo hab\u00eda resuelto por estar cegado en el problema, la librer\u00eda que estoy utilizando es la Xbee para Arduino, eta librer\u00eda no funciona si los nodos no est\u00e1n configurados como API con secuencias de escape habilitadas. Como todo en el mundo de Arduino el s\u00edntoma es absolutamente esot\u00e9rico y no \u00a0 da pistas del problema. En este caso los paquetes de los nodos llegaban al coordinador rellenos de ceros.<\/p>\n<p>El segundo problema, no funciona en un Arduino basado en el chip 328, era un problema de RAM. Cualquiera que trabaje con Arduino sabr\u00e1 que cuando se supera la capacidad de la RAM los s\u00edntomas son completamente aleatorios, no se puede saber la RAM que se consume en cada momento, etc.<\/p>\n<p>Hoy he decidido probar el sketch quitando todas las partes prescindibles, y el s\u00edntoma ha cambiado, he cargado una funci\u00f3n para ver por pantalla la memoria y la he puesto en varios puntos donde cre\u00eda que fallaba, efectivamente en algunos la memoria libre era cero.<\/p>\n<p>Una vez confirmado que este era el problema me quedaba la parte complicada de resolverlo, despu\u00e9s de m\u00e1s de 15 d\u00edas comprimiendo el programa no lo ten\u00eda claro, lo que he modificado son las funciones que recib\u00edan el contenido de los paquetes como par\u00e1metro, definiendo una \u00fanica variable para el contenido del paquete en el sketch, despu\u00e9s de algunos problemas todo ha funcionado.<\/p>\n<p>Lo que no he conseguido todav\u00eda es que me funcione en la placa Xboard (para la que ya ten\u00eda caja), por lo que lo he montado en una de Itead Studio, (29$, con POE, tarjeta SC y Ethernet), la l\u00e1stima es que es de un tama\u00f1o un poco m\u00e1s grande y no ten\u00eda niguna caja, pero soy una persona de recursos, ah\u00ed van unas fotos.<\/p>\n<div id=\"attachment_1161\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg\"><img aria-describedby=\"caption-attachment-1161\" loading=\"lazy\" class=\"size-full wp-image-1161\" title=\"gatewayOpendomo2\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg\" alt=\"\" width=\"500\" height=\"313\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2.jpg 500w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo2-300x188.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-1161\" class=\"wp-caption-text\">bMotesGateway 1<\/p><\/div>\n<div id=\"attachment_1162\" style=\"width: 510px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg\"><img aria-describedby=\"caption-attachment-1162\" loading=\"lazy\" class=\"size-full wp-image-1162\" title=\"gatewayOpendomo1\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg\" alt=\"\" width=\"500\" height=\"452\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1.jpg 500w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/gatewayOpendomo1-300x271.jpg 300w\" sizes=\"(max-width: 500px) 100vw, 500px\" \/><\/a><p id=\"caption-attachment-1162\" class=\"wp-caption-text\">bMotesGateway 2<\/p><\/div>\n<p>La parte positiva es que ma\u00f1ana puedo comprar una caja en un estanco&#8230;<\/p>\n<div id=\"attachment_1163\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg\"><img aria-describedby=\"caption-attachment-1163\" loading=\"lazy\" class=\"size-full wp-image-1163\" title=\"funda-paquete-tabaco-plastico-disponible-col\" src=\"http:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg\" alt=\"\" width=\"600\" height=\"600\" srcset=\"https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col.jpg 600w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col-150x150.jpg 150w, https:\/\/blog.whatsbee.net\/wp-content\/uploads\/2012\/03\/funda-paquete-tabaco-plastico-disponible-col-300x300.jpg 300w\" sizes=\"(max-width: 600px) 100vw, 600px\" \/><\/a><p id=\"caption-attachment-1163\" class=\"wp-caption-text\">Cajas para paquetes de tabaco<\/p><\/div>\n<p><!--:-->&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Following yesterday\u2019s post, the inspiration finally has arrived. The first problem was that the network didn\u2019t function with the Arduino Mega. The library I am using is one for the Arduino Xbee, and this library does not work if the&hellip; <br \/><a class=\"read-more-button\" href=\"https:\/\/blog.whatsbee.net\/?p=1160\">Leer m\u00e1s<\/a><\/p>\n","protected":false},"author":1,"featured_media":1161,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[15,16,2,20,7,21,9],"tags":[35,56,109,126,164,173,197],"_links":{"self":[{"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/posts\/1160"}],"collection":[{"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1160"}],"version-history":[{"count":1,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/posts\/1160\/revisions"}],"predecessor-version":[{"id":7586,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/posts\/1160\/revisions\/7586"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=\/wp\/v2\/media\/1161"}],"wp:attachment":[{"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1160"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1160"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.whatsbee.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1160"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}