Recent Posts

Pages: 1 2 [3] 4 5 ... 9
Decider / Re: WebSockets JSON Communication Protocol
« Last post by Cube on January 30, 2018, 04:48:47 PM »
Quite happy with the progress in Decider today on both the cleanup and re-thinking of the vinterface protocol and the newly forming jsonii web socket protocol, I went to update my test container to the latest versions of the code. Quickly I ran into the issue that the version of libwebsockets that ships with Fedora 26 (which I had been running) was 2.2-based. Decider's code now includes features and functionality of the 2.4 series of libwebsockets, so I upgraded the container to Fedora 27, which brought with it libwebsockets 2.3. Still not quite enough. I then installed the 2.4.0-1 package of LWS from Fedora 28 rawhide, compiled and ran, only to be met with this old error (segmentation fault) when I tried to connect to the web socket server:

Thread 7 "websocket" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fffee5ea700 (LWP 15462)]
0x00007ffff577fdc0 in SSL_get_SSL_CTX () from /lib64/
Missing separate debuginfos, use: dnf debuginfo-install gsoap-2.8.49-3.fc27.x86_64 json-c-0.12.1-5.fc27.x86_64 libwebsockets-2.4.0-1.fc28.x86_64 libxml2-2.9.7-1.fc27.x86_64 mariadb-libs-10.2.10-2.fc27.x86_64 openssl-libs-1.1.0g-1.fc27.x86_64 xz-libs-5.2.3-4.fc27.x86_64 zlib-1.2.11-4.fc27.x86_64
(gdb) info stack
#0  0x00007ffff577fdc0 in SSL_get_SSL_CTX () from /lib64/
#1  0x00007ffff67ba378 in lws_server_socket_service_ssl () from /lib64/
#2  0x00007ffff67bd771 in lws_adopt_descriptor_vhost () from /lib64/
#3  0x00007ffff67bdb13 in lws_server_socket_service () from /lib64/
#4  0x00007ffff67af529 in lws_service_fd_tsi () from /lib64/
#5  0x00007ffff67bbc0b in _lws_plat_service_tsi () from /lib64/
#6  0x0000000000445f3a in websocket_server_main () at ws/ws-serv.c:197
#7  0x00007ffff717d61b in start_thread () from /lib64/
#8  0x00007ffff4ffb98f in clone () from /lib64/

Ah, the dawning recollection that in order to get it working on my development VM I'd had to compile lws from source with SSL disabled in order to get it to work properly. Here lies the fork now set in the road before me: Do I pursue resolution with the stock standard version of the library, trying to figure out why it crashes with an SSL error even though I am not using encrypted connections in my tests, or do I build lws from source, remove SSL functionality (which I know works) and continue on my merry way?
Decider / Re: WebSockets JSON Communication Protocol
« Last post by Cube on January 30, 2018, 10:02:35 AM »
Now I am faced with a bit of a shift in approach. Whereas with the vinterface protocol was so succinct that I could just fire off update messages as their own, single entities, it probably makes sense to amalgamate similar messages in the JSON format into a single message with multiple members. However, this changes the way messages get prepared and there is a bit more overhead since you have to create a message "object", populate it with your payload data, and then commit or send the completed message object in the end. This, as I said, contrasts with the vinterface approach where each payload was it's own message. Is there a benefit to keeping this mentality, even if it adds overhead to the packages? For the example above, would it make more sense to deliver the message as shown, or to send three individual "VintValues" messages? It is certainly possible that I am over-thinking this. :| I think I will take the same approach as the vinterface style protocol - one message per JSON object.
Sensors / Re: Toilet Flush Sensor, Version II
« Last post by Cube on January 29, 2018, 11:24:39 AM »
On a similar note, I checked my data the other day and was dismayed to find that NONE of my toilets are logging any changes - all of them show normal status even when you flush them. Inspecting the sensors, I found that all three of them suffered the same bizarre fate - they all failed in a dead short, which caused their inputs to remain in the "normal" state - even when a magnet was nowhere near the sensors. I pulled one of them apart and discovered first that it was full of water and crud - possibly a side effect from being mounted inside a toilet tank, though they are all above the water line. Perhaps each one got splashed at some point, and clearly despite the appearance of being so, they are not water proof! Ironically, it appears that they got water inside the silicone seal where the wires enter the plastic housing, and then that same seal RETAINED the water inside the plastic body. What was even stranger though, was that once removed and the tiny glass magnetic switch cleaned up - it too, while being impervious to water, had failed such that the metal strip did not move anymore! It appeared to be fused! So now I am tasked with replacing all three sensors, this time it will be a different model and hopefully one that fares better and lasts longer.
Decider / Re: WebSockets JSON Communication Protocol
« Last post by Cube on January 28, 2018, 02:41:36 PM »
Here is an example of the first working command in the JSONii protocol. When a new client connects to Decider's websocket interface, one of the first things it is going to want to do is register to receive the real-time status of one or more Value Interpreters (VINTs). For example, to register to receive status from VINTs 21315, 21319 and 21311, the client would send the following JSON to the server on the websocket interface:

Code: [Select]

Decider would add these value interpreters to the session of this client, send the current value and status of each of the requested VINTs, and any subsequent updates to any of those values would be sent to the client. This is the message that would be initially received after the registration request above:

Code: [Select]
   "VintValues": [
       "VUID": 21315,
       "DeviceStatus": 1,
       "Value": 0
       "VUID": 21319,
       "DeviceStatus": 1,
       "Value": 0
       "VUID": 21311,
       "DeviceStatus": 1,
       "Value": 0

From this point forward, this client will receive updates to either the value or the device status of these Value Interpreters.
Decider / WebSockets JSON Communication Protocol
« Last post by Cube on January 28, 2018, 09:25:36 AM »
In order to help facilitate and expedite the Web User Interface development, I have begun implementing a new WebSocket protocol that exchanges messages in JSON format. The development of this protocol will be described here, since it is also a good medium in which to discuss the development process and its' progress.
Energy Management & Monitoring / Venturii Smart Water Meter Reader
« Last post by Cube on September 26, 2017, 10:46:15 AM »
I am very excited to announce that the initial test runs of the prototype Venturii Smart Water Meter Reader have gone VERY well, monitoring in real time and logging every 1/100th of a gallon of water used in my house! It is able to report Flow Rate, totals per day, and the Venturii graphing engine is presently displaying cumulative values organized by minute, hour, day, or month.

I've long been quoted as saying that the first step to reducing your consumption is to monitor it. In our house of 6 people, I know that we use a fair bit of water, between the toilets, laundry, 6 people bathing / showering, the dishwasher running each day plus irrigation during the summer months. Now with this exciting device, you can affix real numbers to those values and say things like "We used 348.4 gallons of water yesterday." Once you get an idea of how much you are using and start measuring it in a meaningful way (let's face it, seeing the grand total in cubic meters once a month does not drive meaningful change in consumption behavior) - you can begin to change the way you think about water, it's use, and the conservation thereof.

I will be posting more information about this product soon! 
General Discussion / BBS / Forum Back Up!
« Last post by Cube on September 26, 2017, 10:34:26 AM »
It's been a few months, but the BBS is back up. This took a back burner as I had upgraded from Fedora 24 to Fedora 25, which changed from PHP5 to PHP7 in the process. At first there was no version of Simple Machines Forum compatible with PHP7, so I waited. After a quick check today I found this version had been released, installed it, and voila! We are back up and running.

Now we just need to get Mark's Venturii system upgraded to the latest software and firmware versions, and we need to get some Venturii devices and software running at Jeremie's house, and hopefully that will generate some feedback and chatter on this web site as we work together to make this great system even better!

At least that is my hope...  ;)
I found the link to the factory reset page in the D-Link DP301+ Network Print Server device. This is what worked for my case:

Code: [Select]
Where x.x.x.x is the IP Address of the D-Link DP301+ Print Server. You should see a reset page that gives you the option of either resetting (rebooting) the device or factory resetting it (restoring all defaults.) After that, I was able to configure it like it was fresh out of the box and it has worked just delightful ever since. :)
Last night I started working on an interesting project. In the 80's movie Sneakers there is a scene at the Playtronics Toy Corporation headquarters where someone swipes their card (yes, it is a mag stripe!) through a card reader, and the camera zooms in on a Dot Matrix printer that prints a line recording the transaction directly to paper. I've always wanted to do that and so finally had an opportunity to look into it. I picked up a couple of Oki Microline 420 dot matrix printers on eBay for a song, and there is nothing wrong with them - in fact, they're actually pretty nice printers as far as the Dot Matrix models I've worked with over the course of my life.

The trouble started with the print server I bought off of eBay also. It came without any details, and turned out to be set to a static IP address and had a password set. It turns out this little guy does not have a physical reset button. I even pulled the cover apart to look for any signs of an obvious "reset pin" inside - nothing leaped out at me. Some posts online suggested using the username of psadmin and the password SYSxxxx where xxxx is the last four characters of the device's MAC address in caps. I tried every combination of case, along with a variety of usernames (admin, psadmin, user, manager, system, etc.) - all with no luck. Then I stumbled across another web site that suggested a URL on the device that bypassed the question altogether and allowed me to either reset (reboot) the device or factory reset it. I chose the latter, and a few moments later, it was fully factory reset. For the life of me I cannot find that site on Google right now, but I will check again when I am in front of the computer that I actually retrieved it from. In any case, I was then able to configure the print server and could print test pages from it to each of the various dot matrix printers I have, but getting it to print lines of text at a time from any Linux computer over the network took some more twiddling.

In the end I came up with a way of using lp to accomplish what I wanted to, and the only downside was that each line it printed created a separate "print job" that went through the cups spooler, but apart from what appeared to be some bloat, it did in fact print my lines. Now to get Venturii to produce those lines of event log text for the printer to encode on paper!
Electronics / Re: Atmel Atmega328P versus Atmega328PB MCU
« Last post by Cube on January 17, 2017, 12:31:21 PM »
The second revision of the Venturii VDAC MID-1 should be compatible with the 328PB MCU's, and you just have to override the device signature when uploading the binary to them with avrdude. That being said, I have not yet tested this as I only built one of the prototypes so far and we are saving the other two boards to try to build them with the Pick 'n Place machine.
Pages: 1 2 [3] 4 5 ... 9