http://wiki.mios.com/api.php?action=feedcontributions&user=Nokoston&feedformat=atomMiOS - User contributions [en]2024-03-29T09:54:30ZUser contributionsMediaWiki 1.19.8http://wiki.mios.com/index.php/Firmware_Flash_Vera_1Firmware Flash Vera 12009-11-15T22:01:02Z<p>Nokoston: /* Mac OS Version */</p>
<hr />
<div>If Vera's power light blinks consistently (not a double pulsing blink) within a few seconds of powering on, then Vera's firmware has become corrupted. This can happen if Vera was unplugged while in the middle of performing a firmware update ("flash"). When it does, you will probably need to use a firmware restoration utility, which runs on Windows. Here is how to restore Vera's firmware once it has become corrupted: <br />
<br />
= PC ( Windows version ) =<br />
<br />
1. Download Vera's firmware and store it on your PC's hard drive. You can get the firmware here: http://download.controlmyhouse.net/betafirmware/ftp/wl500gP_Luup-1.0.979.trx <br />
<br />
2. Download the firmware restoration utility and unzip it into a folder on your PC. The utility is here: http://download.controlmyhouse.net/flash_firmware.zip <br />
<br />
3. Connect your PC's network connection the LAN 1 port of Vera. (It <u>must</u> be LAN 1, not any of the other LAN ports.) <br />
<br />
4. Give your PC a static IP: 192.168.1.2, with subnet mask 255.255.255.0. You can leave the Gateway and DNS server blank. To do this in Windows XP, choose Start, Control Panel, Network Connections. Be sure all connections are disabled except for "Local Area Connection", which you right-click on and choose Properties. Scroll down to "Internet Protocol (TCP/IP)" and click Properties. Make note of the current settings so you can restore them when you're done. Choose "Use the following IP address", and put 192.168.1.2 in the IP address field and 255.255.255.0 in the subnet mask. Leave the other fields alone. Click 'OK' to close the window, and then 'OK' on the other window. <br />
<br />
5*. Run the program 'rescue.exe' (downloaded in Step 2). Click 'browse' and find the firmware file (downloaded in Step 1).<br>NOTE:You may need to disable your anti-virus software to run 'rescue.exe'. The anti-virus might think this is malicious code. <br />
<br />
6. Unplug the power to Vera. Hold the black button in while you reconnect the power. Let go of the black button when the power light starts blinking. <br />
<br />
7. Click 'upload' in the firmware utility. It takes up to 5 minutes to flash the firmware.<br> <br />
<br />
'''Note''' <br />
<br />
(*) The rescue utility is known to work only on Windows XP and with only ONE network card (disable wireless and other network cards if your computer has any)<br />
<br />
= Mac OS Version =<br />
<br />
Tested it on one of our test unit. It worked and should work for you as well if you follow exactly the instructions.<br />
First, download the firmware version http://download.controlmyhouse.net/betafirmware/ftp/wl500gP_Luup-1.0.979.trx and put it somewhere in the root directory of your Mac or another place and remember the path.<br />
<br />
Notes: Now, you may need to manually specify your computers IP address as discussed in the previous mails (in order to use tftp to upload the files) if for some reason DHCP is not working. I also did this by entering the following settings:<br />
<br />
IP address: 192.168.1.10<br />
<br />
net mask: 255.255.255.0<br />
<br />
gateway: 192.168.1.1<br />
<br />
DNS: 192.168.1.1 (optional)<br />
<br />
More you can read here about setting up networking on Mac OS: http://www.net.princeton.edu/mac/network-config-x/tcpip-enet.html<br />
<br />
<br />
* Step 1: Connect your computer via ethernet cable to LAN port 1<br />
* Step 2: Unplug the power cord from the router<br />
* Step 3: Wait 20 seconds<br />
* Step 4: Press and hold the reset button on the back of the router. Note that the reset button is recessed and you need a pen or paper clip to press it in. The button protruding from the back is the EZ Setup, which is not what you want to press.<br />
* Step 5: While holding the reset black button, plug the power cord into the router. Continue to hold the reset button until the power light starts flashing. Let go of the reset button.<br />
<br />
* Step 6: Can be done using 1) Terminal.app (command line) or 2) TFTP client with GUI.<br />
<br />
1) Start Terminal.app (inside /Applications/Utilities) and go to the directory where you have saved that file (cd /your/directory/). <br />
<br />
Then use this commands:<br />
user@box:$ tftp 192.168.1.1<br />
> mode binary<br />
> trace<br />
> put wl500gP_Luup-1.0.979.trx<br />
<br />
<br />
2) You can download MacTFTP Client from http://www.versiontracker.com/dyn/moreinfo/macosx/8122 for example.<br />
<br />
Start MacTFTP, type "192.168.1.1" inside the Address field.<br />
Click on the "File..." button and select the firmware file you want to update Vera with and click "Start".<br />
Wait for completion and proceed to next step.<br />
<br />
* Step 7: Tftp should report a successful file transfer in 10-20 seconds. The router will load the firmware and begin to flash it into nvram. During this time, the power indicator on the router will go out. Wait until this light comes back on, or wait at least 8 minutes for the flashing process to complete. If the power indicator has not come back on after 8 minutes, cycle the power on the router. <br />
* Step 8: Unplug the power cord from the router, wait 20 seconds, and plug the power cord back into the router WITHOUT PRESSING THE BLACK BUTTON. In less than a minute, your Vera is up.<br />
<br />
<br />
The Vera should now boot to the new firmware. Go to 192.168.1.1 or 192.168.81.1 to confirm. You may need to power cycle your cable modem (if applicable) to get an internet connection and setup the network to automatically get settings via DHCP again.<br />
<br />
This is the Mac OS version of the firmware restoration since the engineers from Asus didn't release an application to do this.<br />
<br />
Also, read this posted on opewrt site: http://nuwiki.openwrt.org/oldwiki/OpenWrtDocs/Hardware/Asus/Flashing</div>Nokostonhttp://wiki.mios.com/index.php/Firmware_Flash_Vera_1Firmware Flash Vera 12009-11-15T21:50:00Z<p>Nokoston: /* Mac OS Version */</p>
<hr />
<div>If Vera's power light blinks consistently (not a double pulsing blink) within a few seconds of powering on, then Vera's firmware has become corrupted. This can happen if Vera was unplugged while in the middle of performing a firmware update ("flash"). When it does, you will probably need to use a firmware restoration utility, which runs on Windows. Here is how to restore Vera's firmware once it has become corrupted: <br />
<br />
= PC ( Windows version ) =<br />
<br />
1. Download Vera's firmware and store it on your PC's hard drive. You can get the firmware here: http://download.controlmyhouse.net/betafirmware/ftp/wl500gP_Luup-1.0.979.trx <br />
<br />
2. Download the firmware restoration utility and unzip it into a folder on your PC. The utility is here: http://download.controlmyhouse.net/flash_firmware.zip <br />
<br />
3. Connect your PC's network connection the LAN 1 port of Vera. (It <u>must</u> be LAN 1, not any of the other LAN ports.) <br />
<br />
4. Give your PC a static IP: 192.168.1.2, with subnet mask 255.255.255.0. You can leave the Gateway and DNS server blank. To do this in Windows XP, choose Start, Control Panel, Network Connections. Be sure all connections are disabled except for "Local Area Connection", which you right-click on and choose Properties. Scroll down to "Internet Protocol (TCP/IP)" and click Properties. Make note of the current settings so you can restore them when you're done. Choose "Use the following IP address", and put 192.168.1.2 in the IP address field and 255.255.255.0 in the subnet mask. Leave the other fields alone. Click 'OK' to close the window, and then 'OK' on the other window. <br />
<br />
5*. Run the program 'rescue.exe' (downloaded in Step 2). Click 'browse' and find the firmware file (downloaded in Step 1).<br>NOTE:You may need to disable your anti-virus software to run 'rescue.exe'. The anti-virus might think this is malicious code. <br />
<br />
6. Unplug the power to Vera. Hold the black button in while you reconnect the power. Let go of the black button when the power light starts blinking. <br />
<br />
7. Click 'upload' in the firmware utility. It takes up to 5 minutes to flash the firmware.<br> <br />
<br />
'''Note''' <br />
<br />
(*) The rescue utility is known to work only on Windows XP and with only ONE network card (disable wireless and other network cards if your computer has any)<br />
<br />
= Mac OS Version =<br />
<br />
Tested it on one of our test unit. It worked and should work for you as well if you follow exactly the instructions.<br />
First, download the firmware version http://download.controlmyhouse.net/betafirmware/ftp/wl500gP_Luup-1.0.979.trx and put it somewhere in the root directory of your Mac or another place and remember the path.<br />
<br />
Notes: Now, you may need to manually specify your computers IP address as discussed in the previous mails (in order to use tftp to upload the files) if for some reason DHCP is not working. I also did this by entering the following settings:<br />
<br />
IP address: 192.168.1.10<br />
<br />
net mask: 255.255.255.0<br />
<br />
gateway: 192.168.1.1<br />
<br />
DNS: 192.168.1.1 (optional)<br />
<br />
More you can read here about setting up networking on Mac OS: http://www.net.princeton.edu/mac/network-config-x/tcpip-enet.html<br />
<br />
<br />
* Step 1: Connect your computer via ethernet cable to LAN port 1<br />
* Step 2: Unplug the power cord from the router<br />
* Step 3: Wait 20 seconds<br />
* Step 4: Press and hold the reset button on the back of the router. Note that the reset button is recessed and you need a pen or paper clip to press it in. The button protruding from the back is the EZ Setup, which is not what you want to press.<br />
* Step 5: While holding the reset black button, plug the power cord into the router. Continue to hold the reset button until the power light starts flashing. Let go of the reset button.<br />
<br />
* Step 6: Can be done either by :<br />
<br />
1) Open Terminal.app (inside /Applications/Utilities) and go to the directory where you have saved that file. <br />
Then use this commands:<br />
<br />
user@box:$ tftp 192.168.1.1<br />
<br />
> mode binary<br />
<br />
> trace<br />
<br />
> put wl500gP_Luup-1.0.979.trx<br />
<br />
OR<br />
<br />
2) You can download MacTFTP Client from http://www.versiontracker.com/dyn/moreinfo/macosx/8122. <br />
Start the application, type "192.168.1.1" inside the Address field, click on the "File..." button and select the firmware file you want to use and hit "Start". Wait for completion and proceed to next step.<br />
<br />
* Step 7: Tftp should report a successful file transfer in 10-20 seconds. The router will load the firmware and begin to flash it into nvram. During this time, the power indicator on the router will go out. Wait until this light comes back on, or wait at least 8 minutes for the flashing process to complete. If the power indicator has not come back on after 8 minutes, cycle the power on the router. <br />
* Step 8: Unplug the power cord from the router, wait 20 seconds, and plug the power cord back into the router WITHOUT PRESSING THE BLACK BUTTON. In less than a minute, your Vera is up.<br />
<br />
<br />
The Vera should now boot to the new firmware. Go to 192.168.1.1 or 192.168.81.1 to confirm. You may need to power cycle your cable modem (if applicable) to get an internet connection and setup the network to automatically get settings via DHCP again.<br />
<br />
This is the Mac OS version of the firmware restoration since the engineers from Asus didn't release an application to do this.<br />
<br />
Also, read this posted on opewrt site: http://nuwiki.openwrt.org/oldwiki/OpenWrtDocs/Hardware/Asus/Flashing</div>Nokostonhttp://wiki.mios.com/index.php/Data_Provider_Catalog_PluginData Provider Catalog Plugin2008-12-17T02:37:03Z<p>Nokoston: </p>
<hr />
<div>This has a general overview of the request architecture. For a list of requests see [[Data_Provider_Catalog_Plugin_Requests]]<br />
<br />
The Data_Provider_Catalog_Plugin runs as a plugin for the DCERouter. It acts as an aggregator for data sources. Other devices in the network can register with it by sending the command CMD_Register_Data_Provider and register to provide data, which is identified by a unique ID. This is intended to replace the DataGrid concept previously in LinuxMCE.<br />
<br />
So, for example, the media plugin can register to provide a set of data with the ID "SongsByArtist", and a security module can provide a set of data with the ID "ListOfSecurityBreaches". These devices register with Data_Provider_Catalog_Plugin, which then becomes a single point for requesting data.<br />
<br />
Request data from Data_Provider_Catalog_Plugin by sending it the message CMD_Request_Data_Provider (ID 971), which includes parameters where you can indicate what format you want the data in (ie XML, plain text, etc.), what input parameters are provided to the data source (ie "SongsByArtist" may require an input parameter of "Artist ID").<br />
<br />
The Data_Provider_Catalog_Plugin is in the category 174 (DEVICECATEGORY_Data_Provider_Catalog_Plugins_CONST). One device that registers to provide general purpose data sources is Shared_JSON_Data_Provider_Plug, and one of the data ID's it registers is "alldata", which returns all the common user data in the system (ie list of devices, scenes, etc.). It provides it in 'json' format.<br />
<br />
So to get this data you can use the MessageSend utility as follows:<br />
/usr/bin/MessageSend dcerouter -o -targetType category 0 174 1 971 10 alldata<br />
<br />
The Data_Provider_Catalog_Plugin also includes a small http service which can be used to request data as well as to send messages which listens on port 3451. Previously when outside applications, like a php page, wanted to send messages they would do a system call to spawn the /usr/bin/MessageSend utility. This is inefficient because it makes a system call each time.<br />
<br />
To request data, request "data_request" from the http server and include the parameters:<br />
<br />
id=id of the data request<br><br />
parameters=parameters to send on the data request<br><br />
input_format=format of the parameters being sent<br><br />
output_format= the desired output format of the data<br />
<br />
for example the following URL returns the same list of 'alldata' described earlier:<br />
<br />
http://192.168.80.1:3451/data_request?id=alldata&output_format=json<br />
<br />
You can also use this to send messages by requesting "messagesend" and adding the parameters:<br />
<br />
from=the originating device ID<br><br />
to=the destination device id<br><br />
type=the type of message<br><br />
id=the message id<br><br />
response=[r|o|c] for Return String, Output Parameters, and Confirmation of delivery. Default=don't wait for response<br><br />
target=[c|t] meaning the 'to' id is not a device ID but rather a Category or Template of device. Default=to is a device id<br><br />
[device data]=some other message parameter where device data is the number<br><br />
<br />
For example, to request a video frame from a camera with the device id #20 you send the message type 1 (command) id 84 (get video frame) and optionally the parameter 60 and 61 (width and height of desired image). The command returns output parameters 19 and 20 where 19 contains the video image and 20 the format. So we want to send message with response=o because we want the request to block until the message is process by device 20 and we want to get back the output parameters. Here is the URL:<br />
<br />
http://192.168.80.1:3451/messagesend?from=1&to=20&response=o&type=1&id=84&60=640&61=480<br />
<br />
The response will be "OK" if the message succeeds, or "FAIL" if it didn't, followed by the values of the output parameters. Because output parameter #20 is defined as 'binary', the result is uuencoded and the U after the 20 indicates this. The above returns:<br />
<br />
OK<br />
<br />
[19=3]<br />
<br />
jpg<br />
<br />
[20U=18373]<br />
<br />
[uu encoded video frame]<br />
<br />
So parameter 19 is 3 bytes long ("jpg"), and 20 is UU encoded with 18373 characters.<br />
<br />
Other plugins can register to provide certain types of data. For example, for each ip camera it manages Generic_IP_Camera_Manager registers the id "camera_control/device #". The parameters it recognizes are: get_video_frame, left, right, up, down, zoom_in, zoom_out<br />
<br />
So the following makes the camera with device id #20 move right:<br />
<br />
http://192.168.80.1:3451/data_request?id=camera_control/20&parameters=right<br />
<br />
and the following returns a single video frame from the camera<br />
<br />
http://192.168.80.1:3451/data_request?id=camera_control/20&parameters=get_video_frame<br />
<br />
If you turn on the findvera.com remote access, you can also securely access your box's port 3451 remotely with to control it, fetch devices, etc. with this syntax:<br />
<br />
https://[ra server]/[username]/[password]/3451/<br />
<br />
Different installations use different remote access servers. The ra server for a given installation is defined in your system file: /etc/cmh/RA_Server. If you have an application that prompts the user for his username/password, such as a cell phone app, call this to get the ra server for a given username: https://findvera.com/get_server.php?username=[username]<br />
<br />
So with a username of testvera9 and password of myvera123, the following:<br />
https://ra1.findvera.com/testvera9/myvera123/3451/data_request?id=simple_device_list&output_format=txt is the list of devices<br />
<br />
== Understanding the messages ==<br />
<br />
The above assumes you understand the basic concept of LinuxMCE messages. The LinuxMCE site contains lots of documentation on messages, and there are user-friendly front-ends for navigating commands, command parameters, etc. The Vera system only uses a small subset of the full LinuxMCE commands. If you're not already familiar with LinuxMCE messaging, here's a quick primer.<br />
<br />
Devices have a given "DeviceTemplate", which is the definition for that type of device. For example, "John's floor lamp" may be device #18, and have the device template #38, "Dimmable light". DeviceTemplates will implement certain commands, like a dimmable light implements command #192 "On". Commands take parameters. For example, the "Dim" command may take a parameter which is the value. DeviceTemplates also fire certain events. For example, a "motion sensor" may fire "Sensor Tripped". Events also have parameters, such as for "Sensor Tripped", there's a flag "Tripped" which can be 1 or 0 depending on if the event is that the sensor is detecting motion, or stopped sensing motion. DeviceTemplates also reference Data, or configuration parameters. For example, a "Dimmable Light" has a configuration parameter #12 "Port/Channel", which, for a Z-Wave device is the node id.<br />
<br />
In LinuxMCE there are web pages to visually present all this data, and the data is stored in a mysql database. As an embedded system, Vera doesn't use a database, rather it stores all the data in .json files.<br />
<br />
Note that you can also retrieve the raw json files directly using a cgi-bin: http://[ip address]/cgi-bin/cmh/get_json.sh?file=xx.json where xx is:<br><br />
devices = the list of devices and all the device parameters<br><br />
user_data = user specified data, like scenes, timers and events<br><br />
template_data = static data defining the structure of commands, events, device templates, etc<br><br />
timezone = the known time zones<br><br />
<br />
so calling http://[ip address]/cgi-bin/cmh/get_json.sh?file=devices.json will return the raw json data file containing the list of devices, and this will be similar to the data returned by the call http://[ip address]:3451/data_request?id=alldata&output_format=json, except the former is returning the raw data from the file system, and the latter is using Data Provider Catalog Plugin's port to return the data.<br />
<br />
The data file template_data has the master definition for Device Templates, commands, events, and data configuration.<br />
<br />
Note that the devices have a hierarchy defined by the FK_Device_ControlledVia. Device 1 is the access point itself, the home. The child DCERouter, in this case device 2, is the message router. The user never needs to see the DCERouter or any of it's children presented on the device list because these are used internally.<br />
<br />
Some devices are what we call "Interface devices", meaning they represent the interface that handles child devices. For example, device #9 is 'Z-Wave' and device #10 is 'Generic IP Camera Manager'. What the user cares about are the children of device #9 (the z-wave devices) and children of device #10 (the cameras). But the interface devices themselves likely wouldn't appear on the device tree you show the users. Note this on the device page.<br />
<br />
Everything you do in the system is based on sending messages to devices. A message has a type. The types are:<br />
<br />
enum eMessageType <br />
{ MESSAGETYPE_COMMAND=1, MESSAGETYPE_EVENT=2, MESSAGETYPE_DATAPARM_CHANGE=3, MESSAGETYPE_REPLY=4,<br />
MESSAGETYPE_DATAPARM_REQUEST=5, MESSAGETYPE_LOG=6, MESSAGETYPE_SYSCOMMAND=7,<br />
MESSAGETYPE_REGISTER_INTERCEPTOR=8, MESSAGETYPE_MESSAGE_INTERCEPTED=9, MESSAGETYPE_EXEC_COMMAND_GROUP=10,<br />
MESSAGETYPE_START_PING=11, MESSAGETYPE_STOP_PING=12, MESSAGETYPE_PURGE_INTERCEPTORS=13,<br />
MESSAGETYPE_PENDING_TASKS=14 };<br />
<br />
you generally just use message type #1, command. Messages have an ID, which is based on the message type. So, for a command (message type 1), id 192 is "Generic On". <br />
<br />
You can get more info on the messages by looking in the template_data: http://[ip]/cgi-bin/cmh/get_json.sh?file=template_data.json<br />
<br />
So, when you're looking at the devices, you'll note that the camera has device template #47. Look in template_data for the "DeviceTemplate" section and you'll see #47 is an "IP Camera". <br />
<br />
To see what commands you can send an IP Camera, look in: DeviceTemplate_DeviceCommandGroup and see that device template 47, the IP camera, implements the DeviceCommandGroups: 26, 54, 68. ie:<br />
<br />
"DeviceTemplate_DeviceCommandGroup_47_26": {<br><br />
"FK_DeviceTemplate":"47",<br><br />
"FK_DeviceCommandGroup":"26"<br><br />
},<br><br />
<br />
Now, looking in DeviceCommandGroup_Command we see command group #26 includes command #84 and 973:<br />
<br />
"DeviceCommandGroup_Command_26_84": {<br><br />
"FK_DeviceCommandGroup":"26",<br><br />
"FK_Command":"84",<br><br />
"Description":"Get's a picture from a specified surveilance camera"<br><br />
},<br><br />
"DeviceCommandGroup_Command_26_973": {<br><br />
"FK_DeviceCommandGroup":"26",<br><br />
"FK_Command":"973",<br><br />
"Description":"Take a picture and store it in the archive"<br><br />
},<br><br />
<br />
to see more on those commands, look in the Command section:<br />
<br />
"PK_Command_84": {<br><br />
"Description":"Get Video Frame",<br><br />
"FK_CommandCategory":"9"<br><br />
},<br><br />
<br />
<br />
So the command is called "Get Video Frame" and the CommandCategory is 9. We can see that from command #84 that it takes a couple parameters by looking in Command_CommandParameter:<br />
<br />
"Command_CommandParameter_84_19": {<br><br />
"FK_Command":"84",<br><br />
"FK_CommandParameter":"19",<br><br />
"Description":"The video frame",<br><br />
"IsOut":"1"<br><br />
},<br><br />
"Command_CommandParameter_84_61": {<br><br />
"FK_Command":"84",<br><br />
"FK_CommandParameter":"61",<br><br />
"Description":"Frame height",<br><br />
"IsOut":"0"<br><br />
},<br><br />
<br />
Parameter #19 is an output paramter and contains the video frame, parameter #61 is an input parameter and contains the frame height, and there are other parameters too.<br />
<br />
According to the section "CommandParameter", the description of the parameter #61 is Height<br />
<br />
"PK_CommandParameter_61": {<br><br />
"Description":"Height",<br><br />
"FK_ParameterType":"2"<br><br />
},<br><br />
<br />
and the type of paramter is an int:<br />
<br />
"PK_ParameterType_2": {<br><br />
"Description":"int"<br><br />
},<br><br />
<br />
Now, look back at the above example for retrieving a video frame: http://192.168.80.1:3451/messagesend?from=1&to=20&response=o&type=1&id=84&60=640&61=480<br />
<br />
You're sending a message of type 1 (a command) and id 84 (get video frame) from device #1 to device #20 (assuming #20 is an ip camera). We want to wait to get the output parameters (so response=o), and the parameter 61 (height) is 480.<br />
<br />
Now the response, which includes [20U=18373], means parameter #19/#20 contain the image and type of image being returned.</div>Nokoston