Skip to main content

json messaging (1/2)

Currently, the messages that the clients and the server are sending each other is just a mess.

They're pretty much just string dumps of whatever textual information I can add to describe what the message should do. 

I pretty much have on_message methods regexing to find certain words for key commands... 

Hence I had a big TODO that reminded me that I have to give structure to these messages, and JSON seems like the best fit for that.

Since the ETA of the servo is set on Monday, I should get this "house cleaning" done for now.

Didn't have much time after I got home today, so I just started reading on JSON for Python. 

Nothing complicated: json.dumps and json.loads. Done? 

As expected, the hard (well, not hard, but requires effor?) part will be organizing the current message structure and not implementation.

Comments

Popular posts from this blog

playing with servos

some servos that I had ordered were delivered. the instructions suggested another brand/model of servos, but these were a much more economical (cheap).  I tried adding them to the hand: I'll have to print the "pulley" pieces that will be attached to the servos. meanwhile, I did somewhat (hackily) got the wrist to work, for now: you keep hearing the "usb plugged out" sound in the background, and that's because the servo was being powered by the arduino. the servo's power draw appears to be causing a shutdown of the device. will need a better power source for the servos. it feels like these pieces that are supposed to be plugged into the servo will have size issues. 

dabbling with android

I've been wanting to dabble with Android development recently, and yesterday I realized that there is a Socket.IO client API available for Java/Android. The API is pretty straightforward, so I loaded a test Android project I had made for going through Android basics and connected to the OpenSesame Node server. and it works! I mean, the interface is non-existent and it's really just bare-bones, but having the servo respond through an Android application was pretty refreshing. (the web client and the android client "communicating" with each other--messaging is pretty much for debugging purposes)

chunk update: most parts printed and assembled

currently: stuff that happened are: wired the fingers added screws to necessary assemblies witnessed first failed print during this: servos haven't come yet, but once they do, we can start installing them into the hand/forearm. as always, credit to the Inmoov project.