Mozilla IoT with Unity

 

Last time I worked on this project I concluded that I needed to use a Raspberry Pi as a proxy that communicated with Unity and created the devices. To get this working I created a Unity tag that is labeled UnityLight. I wrote a script that then searches through all the GameObjects and finds the ones with these tags. Then it grabs the name of the object and sends those in a JSON string packet to the raspberry pi proxy.

The JSON strings contain keys for each type of object being created, in this case just UnityLight. The value is then an array of GameObject names. The proxy reads the JSON string and creates the game objects based off the names. Those objects then show up in the Mozilla IoT as you see above and you can add them. Theoretically, I can then send data from the proxy back to Unity and update the GameObejcts based on the states of the Mozilla Gateway. However, I couldn’t get this working in a very streamlines process today so I postponed this until tomorrow.

More details are on my GitHub project.

Leave a comment