loading program in econotag (contiki 2.7) - c

I am currently trying to run my code(written and compiled in contiki 2.7) in econotag. However i wasn't able to do so. I can compile with out any problem using
make TARGET=econotag hello-world.
but when i try to upload using the command
make TARGET=econotag hello-world.upload
the following message appears
../../platform/econotag/Makefile.econotag:10: ../..
make: *** No rule to make target `hello-world.upload'. Stop.
I know it used to work perfectly in contiki-2.6 with TARGET=redbee-econotag. so i tried it but the message was
**** This platform is old and will soon be removed ****
please use TARGET=econotag instead.
(or set ALLOW_OLD_PLATFORMS=1 to proceed)
. Stop.
I have seen some posts about installing the tool chain for uploading on econotag. but they didn't provide step by step procedure.
can anyone tell me what/how i should to install the tool chain to solve this problem and what command i should use after installation.

Here is how my colleague solved it
first compile the program you want to load (in this case hello-world) with
the command
make TARGET=econotag hello-world
note that this will generate a binary file with file name hello-world_econotag.bin (in the same directory with the code)
then go to directory
contiki-2.7/cpu/mc1322x/tools
and execute the pearl script used to upload binary files. (use the following command)
sudo ./mc1322x-load.pl -f "path to your binary file" -t /dev/ttyUSB1
this will upload the binary of your code to the econotag.
then reset your device (either with command or manually)
and the code should be running now

Related

Redirecting C system() output fails only with yq

I'm using yq to convert a YAML document into JSON for use in a C program. In my program, I convert the file to JSON using the command
system("yq ea \'[.]\' -o=json .cache/BT_nginx-ingress.yaml > .cache/package.json")
However this causes the error:
Error: write /dev/stdout: permission denied
Thoughout my program, I've used redirection several times with the system() command, but it fails in this specific instance.
I can run the command normally from the terminal, without root. I'm using bash on PopOS, so I've also added bash -c to the above system() call, but it fails this way too.
Can anyone help me with this? Thanks!
Edit: More details on my configuration. The current working directory is the same as the program's location which is one directory above .cache. The working directory is never changed. I am the owner of .cache and the files inside. The permissions are r/w for me, and the group. I am running the process but not with sudo. system("echo foo > .cache/package.json") works!
I have managed to fix this issue by adding the yq_linux_amd64 binary with the C program itself, rather than using the yq package from snap. It works fine now, and can redirect outputs without any issue.

VOLTTRON install on rasbian buster

Can I get a tip for installing on rasp buster? Im hung up on the install directions to check the status of the rabbitMQ server. Traceback of bash console:
(volttron) pi#raspberry:~/Desktop/volttron $ echo 'export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7'|sudo tee --append ~/.bashrc
export RABBITMQ_HOME=$HOME/rabbitmq_server/rabbitmq_server-3.7.7
(volttron) pi#raspberry:~/Desktop/volttron $ source ~/.bashrc
pi#raspberry:~/Desktop/volttron $ RABBITMQ_HOME/sbin/rabbitmqctl status
bash: RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory
There are a few tracebacks earlier on the installation...
If it makes a difference or not here is the entire bash console process. The git gist link I just created the name install.py even though its just bash commands copied pasted per install directions...
`pi#raspberry:~/Desktop $ git clone https://github.com/VOLTTRON/volttron --branch releases/7.x`
It looks like there are a couple of different issues going on here:
The issue you quote above (RABBITMQ_HOME/sbin/rabbitmqctl: No such file or directory) is that your shell isn't finding the rabbitmqctl command. It looks like you added the RABBITMQ_HOME environment variable to your .bashrc, but used the string RABBITMQ_HOME instead of the variable expansion $RABBITMQ_HOME when you tried to run the command. Try running it as $RABBITMQ_HOME/sbin/rabbitmqctl status instead.
The rabbitmqctl status command will check the status of the rabbitmq application, but I don't think you've done anything to start it yet (that happens when you bootstrap the platform and/or start the platform configured to use the RMQ broker)
I think that the traces earlier in the installation process are problematic (appears to be the same error hit two different ways), but you just haven't run into them yet. I haven't seen any issues building gevent on the RPi 4 with buster (though it is pretty slow), but the ctypes error makes me wonder if there's an issue with the underlying c library it is trying to build on top of. I did notice that you're getting amd64 erlang packages, are you running Raspbian on an x86 processor? (if so this isn't a permutation we've tried and you may be hitting some package compatibility edge case we haven't seen)
One thing to try is to manually install cython into your virtualenvironment and then try running the bootstrap script again with the virtualenvironment activated. You could also try and pip install gevent==20.6.1 directly in that virtualenvironment (this is what the bootstrap script was doing at the failure point). VOLTTRON depends on gevent, so if that isn't installing the platform won't be able to run.

"UnetStack libraries missing" error received when trying to run UnetStack simulation script from command line

I am trying to run my UnetStack simulation script using command line. My simulation file is in the sample folder, and I open a terminal window in the unet folder (where README.txt exists). I followed the README.txt instructions, and I tried to run other simulations script from the sample folder, but I always get the following error:
ERROR: UnetStack libraries missing...
However, everything works well if I run the simulation using IDE. I will be grateful if you help sort out this problem, so I run the simulation through command line.
I tried to run the simulation script using command line. I followed README. txt instructions, but it didn't work.
I tried this: bin/unet samples/super-tdma/e3-network.groovy and many other simulation scripts.
This is to make sure that my question has been posted, as I can't see it within the listed questions.
You can use v1.3 or
In v1.4, Copy all the Items from the folder "UnetID" to the "root folder", then run the simulation.

Nagios Plugin Error: (No output on stdout) ... failed. errno is 2: No such file or directory

I am using custom Nagios plugins for the first time and am running into this error when I create a service for the plugin.
(No output on stdout) stderr: execvp(/usr/local/nagios/libexec/check_load.py, ...) failed. errno is 2: No such file or directory
The plugin works when I run it on the command line, however does not work when it runs within Nagios.
I followed these steps to get the plugin into Nagios
https://assets.nagios.com/downloads/nagiosxi/docs/Managing-Plugins-in-Nagios-XI.pdf
Here is what it looks like in the Nagios UI
The plugin is in the correct path: /usr/local/nagios/libexec and the resource.cfg file has the same path within it.
I tried two separate plugins, both which work on the command line, and the result is the same error.
The error indicates the file location is incorrect, however the plugin is in the specified directory and runs with no errors within that directory.
I am totally stumped and appreciate any help.
For anyone reading this, I solved the problem.
The first time I added the plugin, I forgot to add the python extension. When I updated the already created plugin, Nagios still threw the error.
Once I completely deleted the plugin and re-created it the 'file not found', error went away.
I faced a similar issue when I was trying to add a custom plugin ( I had custom plugins in ruby and python ).
The issue was the missing shebang line at the start of the script (which determines the script's ability to be executed like a standalone executable).
For example, if you have a python plugin custom-plugin.py then make sure this script has shebang at the start of script #!/usr/bin/env python3. Also if you have other scripts (ruby, bash etc.) make sure to add the appropriate path at the start of your scripts.
Also, check the path for plugins Nagios version. For my setup path was /usr/local/nagios/libexec/ and make sure your custom plugin is executable and has correct ownership permissions.
Sample custom template I used :
define command {
command_name check_switch_health
command_line /usr/local/nagios/libexec/check_snmp.rb --host $HOSTADDRESS$ --model "$ARG1$" --community "$ARG2$"
}
The above workaround worked for me.

DocBlox error: The XSL writer was unable to find your XSLTProcessor

I am using WAMP on my local machine and I'm trying to use docblox to generate documentation for a project.
When i try to run the docblox command in my command prompt for a file that has the necessary comments, I get the error message.
C:\wamp\www\wm-ppclps>docblox run -f wm-ppclps.php -t documentation
DocBlox version 0.18.1
Starting transformation of files (this could take a while depending upon the size of your project)
ERROR: The XSL writer was unable to find your XSLTProcessor; please check if you
have installed the PHP XSL extension
I have no idea why this is error message is appearing. The command creates the documentation folder, parses the source code and it produces the structure.xml file. It just won't transform the structure into an HTML file or any other readable file.
I added the PHP install directory to my system path, I installed PEAR system wide, added PEAR install directory to my system path, installed DocBlox using the docblox pear channel, I have the necessary environment variables setup. I uncommented the php.ini line to enable the php_xsl.dll extension for WAMP and restarted WAMP. When I view the phpinfo, i see that the XSL extension is enabled (XSL version 1.1.23, compiled against libxml version 2.6.32, EXSLT enabled).
Does anyone have any idea why this is happening, has come across this problem or can point me in the right direction for an answer?
The error that you are receiving means that php does not recognize the xsl extension.
Php has got a separate ini file for CLI and web; and I presume that you have enabled the xsl extension for apache only.
You can verify this by executing php -i in your command prompt and check if the xsl extension is enabled there. If not then add your dll to the right config for your WAMP.

Resources