^RAF command?
vining
Posts: 4,368
"'^RAF-<resource name>,<data>'" Add new resources. Adds any and all resource parameters by sending embedded codes and data. See below for the Embedded Codes information.What if the resource already exists? Will it overwrite or do nothing? I know if it exists I can use the ^RMF command to modify it.
"'^RMF-<resource name>'" Modify an existing resource.I want to get away from creating dynamic images in the TPs cuz if you change an IP address for instance it's a pain to update all TPs. So my thinking is in the AxisCamera_Mod I would use the RAF in either define start or the online event but I don't know what happens after that resource has been created, will it just overwrite itself every time which is what I would want in case there's modifications in the code to any of these values. But since there's the ^RMF command for modifications maybe the ^RAF command won't work to re-write.
0
Comments
I'm running out of things to try other than deleted all the dynamic images on the TP and trying again, maybe change the %N value to 0 since I'm not sure what is does and I've been trying 1.
If anyone see any f '-ups in the code please let me know. I've spent the entire afternoon screwing around with this and this has nothing to do with my intended objectives for today, go figure!
Hmmm, just had a thought, maybe I should send to port 1 of the TP's. Unfortunately I don't recall if this has ever been an issue but it's worth a try.
Results in the notifications window:
As a workaround, you can try sending the ^RMF command, then follow up with a button hide command (^BMF-addr,0,%SW0), then show command (%SW1).
To answer your original question, the ^RAF command will have no effect if the resource already exists, even if some of the parameters are different. You can try defining all your resources up front (with the ^RAF or in the TPD4 project), then making all subsequent changes via ^RMF (using the above workaround where relevant).
Add to the fix it list for the ^RMF & possibly the ^RAF command that if you send %H IP strings w/ leading 0's (zeros) in an octet that IP address won't work.
I've been going back & forth in NS3's "control a device" & eventually I tried sending IP's w/o the 0's and it worked. Now I was only using 0' since it makes my IP Array more uniform & I'm one of those neat freaks. I kept thinking it may be an issue but kept telling myself I was being stupid, they have to resolve addresses w/ 0's in them, it only make sense, right?
This don't work:
192.168.001.082
This do:
192.168.1.82
Are you positive ^RAF is ignored if the resource already exist? I think life would be simpler if using the ^RAF command you could create a resource if it doesn't exist but overwrite it (modify) if does. Now I'll have to send both when the TPs come online.
Could you explain the %N variable. What is it?
I did a system where I tried to make the background image change periodically and pull the images from an ftp server with client pictures on it. It too had similar issues that were hard to nail down. The only consistent symptom was time. It would work like a champ for a while. After some days each panel in the house would slowly loose its ability to change images. It wasn't a wholesale loss of ability either. It would first change sometimes, then less and less until it finally failed to change altogether. There was no rhyme or reason to it seemingly. I telneted into the panels and they would show they were changing the images as ordered, but they weren't.
Strangely enough, a reboot of any of the component parts (Touch panel(s), Netlinx Master or FTP server) would not get it all working again. You had to do all three. It was one of those things that I've always wanted to fix but ended up just disabling. I thought I'd get back to it some time but never did. Now, the client has sold the property and there's no point now.
Suffice it to say that there's still some soft baked parts of the implimentation of ^RAF
I use RMF all the time in my weather module that polls noaa. I just pull the info from the web page and search for that text for jpg.
Obviously you have to do a lot of pre-planning, but mine has worked like a champ now for over a year.
I should start keeping track of how many hours I waste a year trying to get things to work that according to AMX are supposed too but don't or they know they don't and they don't proactively put the word out until it's too late for some of us.
Ya know If I'm going to loose my certs this year because I refuse to knowingly waste time doing those useless practical exams I think some folks at AMX should loose something too for wasting as much of our time as they do.
I got my small images to work through code and control device but I still can't get the large files to work which makes me think it's something with the way my string is formatted but with these commands for dynamic images it often is just bugs in the commands. Kinda like the leading 0's in the octets of the IP address, should work but it don't!
Vining,
I understand your frustration with the leading zeros - intuitively I would agree with you that they should be discarded. However, historically, operating systems have interpreted leading zeros to mean "Octal notation" (even as recently as Windows 2000 did the same thing, and most ..nix variants still do). To test this, try the octal equivalent of the last 2 octets of your address, which would be 192.168.01.0122. This would be converted to 192.168.1.82 and should work. Obviously, it is highly unlikely anyone would ever do that, so I have written an internal ticket to consider changing this behavior (in your case it is admittedly all the more confounding because 82 is not a valid octal number!). Will keep you posted.
The ^RAF definitely is ignored if the resource exists (good point though about having a fallback option to modify the resource if it already exists). As for the %N option, it was originally intended to define behavior when FTPing images using wildcards. However, there is currently no alternative to the "newest file" policy (i.e. setting this to 0 does not change the policy), so this option essentially is unused.
Thanks,
Scott
AMX Firmware Engineering
Thx for the feedback. I don't know if this has already been addressed & fixed but it used to be that we were unable to use a user & passwords for http type dynamic images stored on the master. If this has been fixed great but if not could you add it to the "to do" list.
Thx
I agree that these type of bugs are super frustrating. If I would have known about this workaround a few years ago....
On the other hand, I am stoked that AMX is taking care of these types of issues (the button hold problem being another one). To know that AMX cares and is actively cleaning up these things makes me feel all warm and fuzzy. Keep 'em coming!!!