Can I download a programm written in C# into nxt 2.0 brick? - nxt

I use C# language and http://www.mindsqualls.net/ library. But I could not find how to download my program into brick. Actually, is it possible? Or I just have to control my nxt 2.0 robot via bluetooth? Are there any languages/libraries which allow to download programs into brick or it is only possible for mindstorms nxt 2.0 visual editor?

First sentence on the MindSqualls site you linked: "MindSqualls is a .Net library for remote controlling your LEGO MINDSTORMS NXT or NXT 2.0 robot ... from your PC ... via a bluetooth or USB connection." So the answer to your question is: no.
If you are able to switch to Java instead, try out LejosNXJ (http://www.lejos.org/). LeJOS comes with an own firmeware, Mindstorms-drivers and a subset of Java and lets you run your programs on the brick.

Related

Can I use NAOqi 2.5 (C++/Python SDK) features on a NAOqi 2.9 (QiSDK) robot (Pepper)?

I have the Pepper robot running NAOqi 2.9, which is meant to use the QiSDK for its Android tablet. Things have been going well, but the photo capture rate is surprisingly slow (at most 2 fps), so I've got to use the C++ (or Python) SDKs available for NAOqi 2.5 for this particular task.
I've been trying to get it to work for a few days with no success. I have setup both the C++ and Python SDKs up and running, but the problem I'm facing is connection to the robot.
I've run the simple following code (using the robot's IP) found on the official website here
from naoqi import ALProxy
tts = ALProxy("ALTextToSpeech", "<IP of your robot>", 9559)
tts.say("Hello, world!")
and I'm getting the following output stream
after the second line
The connection problem occurs running either C++ on Ubuntu, or Python on Windows.
I can connect to the robot via SSH, FTP, QiSDK in Android Studio, but not in any way through the NAOqi 2.5 SDKs for C++ or Python. Since QiSDK was most probably build on top of the C++ SDK, there surely has to be a way to make this to work.
Any information will help immeasurably.
As far as I know, in NAOqi 2.5, the tablet (JavaScript) and the "brain" (Choregraphe i.e. Python / C++) of the robot were two independent devices and had to communicate and cooperate with each other. In NAOqi 2.9, the "brain" was moved to the tablet and the only way to program Pepper is by using Android Studio.
On the download page for Pepper NAOqi 2.9 (https://www.softbankrobotics.com/emea/en/support/pepper-naoqi-2-9/downloads-softwares), there is a comment regarding the Python SDK:
This is for old NAOqi 2.5.10 and NAOqi 2.5.5.
And the following is stated for NAOqi 2.9 / Pepper SDK Plugin [for Android Studio]:
This is all you need for Pepper NAOqi 2.9.
Therefore, according to Softbank Robotics' documentation, using Python / C++ to program a NAOqi 2.9 Pepper is not possible.
I hope this information answers your question.
Edit
There's another way, you can use the qi Python library inside Pepper's head, in order to use services, such as ALTextToSpeech or ALMotion, with a simple example here. One could also only use SSH to start a Python server, which would give access to these functionalities through endpoints.
import qi
app = qi.Application()
app.start()
session = app.session
tts = session.service("ALTextToSpeech")
tts.say("Hello Word")
If you run the above snippet inside Pepper's head it produces the expected output(saying Hello world). There are almost all the services that are documented here. You can also list them all by calling .services() on the session object
End of Edit
I finally found a way to hack into it. If you connect to the robot via SSH you can use the qicli binary. Its documentation is here
qicli info lists all services available, for example ALVideoDevice or ALMotion
qicli info ALMotion displays the available methods of that service
qicli info ALMotion.setAngles displays info about that method's parameters
qicli call ALMotion.setAngles HeadYaw 0.7 0.3 calls the function in the module with given parameters
So one could write a wrapper to this binary and call it programmatically via SSH, it seems like a lot of work for this kind of task but I haven't found anything else.
I've got Python's Paramiko library to work:
import paramiko
client = paramiko.SSHClient()
client.set_missing_host_key_policy(paramiko.AutoAddPolicy())
client.connect(hostname='ip-of-robot', username='nao', password='your-pass')
stdin, stdout, stderr = client.exec_command('pwd')
print(stdout.read())
client.exec_command('qicli call ALMotion.setAngles HeadYaw -0.7 0.2')
client.close()
I've also tried .NET's SSH.NET library, with little to no success.

Mbed: some basic questions

I am new in MbedOS.
I am so confused about following questions.
1. What's the difference between yotta and CLI?
2. How do I port the MbedOS to my board?
3. What's the difference between Mbed 2.0 and 3.0?
Thank you..
Answers inline
What's the difference between yotta and CLI?
Yotta is the build tool used to build mbed v3 projects. mbed CLI is the tool used to build mbed v5 projects. The breif history is v3 was not backwards compatible with v2, aka mbed classic, so we took the best parts of v3 and the best parts of v2 and put them together to form mbed v5. In mbed v5, just like in v2 you can use the online compiler (https://developer.mbed.org/compiler) or you can compile offline. The tool known as mbed CLI is the same tool that sits behind the online compiler, its just been wrapped up so you can use it on your machine if you prefer. (ie you can run mbed compile on your machine instead of clicking the compile button on the online compiler)
How do I port the MbedOS to my board?
Vendors are in the process of adding mbed OS 5.0 support to most of the mbed boards on the website. If your board isn't supported yet then hold tight, it will be soon. If you want to add support for a board you have created then you can apply via the mbed enabled program (https://www.mbed.com/en/about-mbed/mbed-enabled/).
What's the difference between Mbed 2.0 and 3.0?
mbed 2.0, also known as mbed classic, was an abstraction layer that made it easy to use traditional microcontroller peripherals. mbed 3.0 introduced an interrupt driven OS along with some really awesome improvements for low power and full stack IoT development. mbed 5.0 takes the best parts of both and combines them in a way that is backwards compatible with mbed 2.0. The biggest difference between 3.0 and 5.0 is the underlying thing in 3.0 was interrupt driven while the underlying bits in 5.0 is the Keil RTX v5 RTOS.

Running Win32 apps compiled for ARM on Windows RT

Say I have a desktop program that uses the Win32 API, but is compiled for the ARM architecture. How do I get it to run on Windows RT (the restricted version of Windows 8 for ARM tablets)? Windows RT refuses to run such apps without a Microsoft signature.
I know there is no official way to do it, but say it is for an in-house deployment, or just for testing purposes. What are my options?
(See this answer for the availability of Win32 API on Windows RT (not neccessarily for Metro apps, but present on the system), and this answer for how to compile Win32 programs for ARM using VS2012.)
Now you can run any app/exe on Windows RT : http://surfsec.wordpress.com/2013/01/06/circumventing-windows-rts-code-integrity-mechanism/
please see this thread,and you can run you exe without a Microsoft signature by CreateProcessA
http://forum.xda-developers.com/showthread.php?t=1944675
And now there is actually a "jailbreak"-like script:
http://forum.xda-developers.com/showthread.php?t=2092158
Usage:
Boot your RT device and log in, allow it to sit on the desktop for about a minute.
Run runExploit.bat, wait for it to do it's thing (shouldn't be more than 20 seconds or so)
Press Volume Down
Wait for runExploit.bat to finish, answer any prompts it gives. They should all be fairly self-explanatory.
It might crash while running the script, and it has to be done after every reboot. Also, I haven't tried it myself. In the post there is a link to a list of recompiled software that might be useful.

What pascal compilers can target embedded ARM with no OS?

Looks like available Pascal compilers can only produce binaries for ARM on Linux. Is there established version of compiler/bundle for just bare ARM cpu with zero extra software preinstalled ?
To clarify, I am looking for high quality, compact tool (alternative to commercial C, open source C) for kernel-less, plain embedded CPU with all software in one plain ROM ? IDE with debugging capabilities is nice to have, but not necessary. Dubugger could actually be some different 3rd party generic IDE. I hope that compilers can dump the debug/symbols info in some standard form.
Thank you
Free Pascal Compiler supports ARM without any OS. They call it TARGET EMBEDDED.
For ARM Linux take a look at this and this.
There is also Lazarus CT edition cross compiler which seams to target sysless ARM too.
UPDATE 1: mikroElektronika has also recently made Pascal compiler for ARM.
UPDATE 2: Ultibo framework for bare metal Raspberry Pi programming looks outstanding.

How do I use the Silicon Laboratories IDE with SDCC?

I'm thinking about using a microcontroller with an 8051 core from Silicon Laboratories.
I hope that I can use C rather than assembly language, so I installed SDCC.
I installed the "Silicon Laboratories IDE" to download the executable binaries to the on-chip Flash program memory.
It also supposedly can be set up (under the Project > Tool Chain Integration menu)
to use "any" 8051 compiler.
I tried to set it up to use SDCC, but every time I hit the "Assemble/Compile File" button it tells me
"Compiler process did not sucessfully complete."
How do I get new C code I write onto the SiLabs C8051F310 chip?
Is there a web site with a step-by-step HOWTO?
(Would it be easier to use a MAKEFILE that calls SDCC, only using the "Silicon Laboratories IDE" for the very last step of downloading the executable binary to the chip?)
Start with Silicon Labs Application Note 198 - INTEGRATING SDCC 8051 TOOLS INTO THE SILICON LABS IDE*. It is written for an older version of the IDE, but the general configuration should remain the same. It is probably important to note that AN198 needs updating for SDCC 3.0.0. Additional information from the Silicon Labs MCU User Forum or Microcontrollers Knowledge Base may prove useful as well.
The SDCC Compiler User Guide* can be useful if additional command line options are desired.
The Silicon Labs USB Debug Adapter can be used with the Silicon Labs IDE and the on-chip debug/programming circuitry of the C8051F310* for programming the MCU and debugging your code.
* PDF Link