Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Kuwait
Asked — Edited

Xamarin And Raspberry Pi

hello,
so i'm planning on developing an iPad application using xamarin forms to control JD through it; and i heard to make such an application i need to use mono sdk provided in this website. i got mono sdk and i got a raspberry pi also. but how can i make xamarin code on my windows 10 communicate with raspberry pi that is connected to its own HDMI screen, keyboard, and mouse? *confused*

should i establish an SSH connection between them? to execute the code written on xamarin using the raspberry pi terminal?

PRO
USA
#1  
I'm little confused with your question. Let’s break down your question so it can be addressed without confusion.

1) Xamarin Development for Apple iOS
Minimal Requirements:
Apple Mac Computer, MacOS, XCode and Xamarin Tools
The process is not simple and requires some time to follow all the steps.

Basically you develop an application and is deployed to an emulator, or a developer device (Requires an Apple developer certificate).

2) Mono SDK
EZ-Robot provides a mono SDK dll to communicate with EZB.

Provides:
Low level functions: Connect, disconnect, servo control (position/speed), digital/analog ports.

Does not provide:
High level functions: Playing sounds, video capture, gait control (walk, dance, move arms, etc), script/workflow execution.

2.1) Mono Applications
The dll can be added to a Visual studio project targeting the mono platform and can be deployed on a Raspberry PI running a Linux distro: Raspbian, Lubuntu, etc.

2.2) Xamarin Development
The dll can be added to Microsoft Xamarin project targeting iOS or Android.
You build the application and is deployed on an emulator or an iOS/android device.

If your main objective is to develop a Xamarin application for a mobile device you don't need the Raspberry PI.

I recommend some reading:
https://docs.microsoft.com/en-us/xamarin/cross-platform/get-started/introduction-to-mobile-development
#2  
Thank you very much ptp you have cleared a lot of ambigous things to me! :)

But i do have few more questions please...

Can i move the projects that i made with ARC into Xamarin?
If not...
One of the games that the ipad application provides is to show a video to the child and then pause the video. then the robot should ask the child questions about the video. And after the child answers; the video can resume to display the correct answer.
As you can see; i need to be able to control when exactly should scripts starts and when they should pause.

So what is the easiest method i could do to achieve this? If as you said; Xamarin with mono does not provide high level functions :(
PRO
USA
#3  

Quote:


Can i move the projects that i made with ARC into Xamarin?

No. ARC projects are only useful for ARC Desktop/Mobile application.

Quote:


If as you said; Xamarin with mono does not provide high level functions

What I said is the EZ-Robot Mono SDK does not provide high level features.
That does mean you can't use Xamarin to build the high level features.
Xamarin is technology behind ARC mobile application.

Quote:


One of the games that the ipad application provides is to show a video to the child and then pause the video.

Feature 1: Playing video and multimedia features.

Quote:


then the robot should ask the child questions about the video

Feature 2: Play sound through EZB. The easiest way is to play recorded voice files.

Quote:


. And after the child answers;

Feature 3: Get screen (iPad) Input (screen buttons).

Quote:


the video can resume to display the correct answer.

Feature1

Quote:


As you can see; i need to be able to control when exactly should scripts starts and when they should pause.

Feature 4: I presume scripts are the gait/auto-position actions used to animate the JD.

There is nothing to convert an ARC project to a custom Ipad Application.

If you are .net developer, Xamarin will be an easy path to develop and deliver iOS mobile applications.

If you are Web/Javascript developer, maybe Cordova or React Native are a better way out to the mobile.

IF you are Mac developer: Xcode and Objective-C and Swift are the best tools.


bear in min whatever path you pick you will need to build the ARC high level features.

IF you need to recreate the low level features (EZ-Robot SDK):

EZB communication protocol
https://www.ez-robot.com/Tutorials/Files/EZ-B%20Protocol%20Specification.pdf

C# Source code for Windows UWP (low level features):
http://synthiam.com/Products/ARC
#4  
Then what did DJ Sures mean when he said that: Xamarin is compatible with the EZ-Robot project to create a native app and he also said that the ARC can be ported to a standalone xamarin app:

www.ez-robot.com/Community/Forum/Thread?threadId=11466

I was using xcode but i switched to xamarin because i thought it could give me a better control over JD movements and scripts. *stress*

Quote:

bear in min whatever path you pick you will need to build the ARC high level features.


If i switch back to xcode; how can i build those high level features of speech recognition, dances, and playing audio from the robot?

Should i put the dll file into xcode project. And then i should use communication protocol to be able to use the low level features? Then what should i do to use the high level features? *confused*

I’m sorry i’m new to all these things so i might be a little slow *tired*
PRO
USA
#5  
Hum.... this is not a new thread... started 2 months ago.
is in your and the community's best interest to follow DJ's advice:
User-inserted image

Context is everything:) !
This would save me time to try to guess what was your question and your goals.
User-inserted image


I believe DJ's intention was to introduce you Xamarin the same technology supporting iOS ARC mobile app.

you have a lot of useful resources and source code:
EZB communication protocol
https://www.ez-robot.com/Tutorials/Files/EZ-B%20Protocol%20Specification.pdf

C# Source code for Windows UWP (low level features):
http://synthiam.com/Products/ARC

can be used to accelerate your App Development special the source code.

Asfaik there is no tool to convert an ARC project to a Xamarin project.
If you are .NET developer and if you are familiar with Xamarin everything makes sense.

Quote:


Take a look at Xamarin first and get the environment up and running - so you can compile an app. Once you're familiar and comfortable using Xamarin, we can give you a few pointers on moving the ARC project to it

It seems you are not familiar Xamarin and you don't have any app ready, so now I understand why the confusion with Mono SDK/Raspberry PI.

Let's forget the Mono SDK, the above links is all you need to implement the communication with EZB. You have the protocol specification and you have c# source code that shows how to implement the low level features (DLL) plus playing sound on EZ-B.

After that you need to develop your app, the complexity depends on your developer knowledge. For example if you need to implement an auto-position feature, you will send a few sequence of servo positions/speeds to EZB.
After that you can create a xml parser to read an ARC project's auto-position information.

Quote:


If i switch back to xcode; how can i build those high level features of speech recognition, dances, and playing audio from the robot?

Yes, you will be coding in objective-c / swift. The application logic is the same the programming language and APIS are different.

Quote:


Should i put the dll file into xcode project.

Forget the dll, does not work with a xcode project. Is only useful if you use with a Xamarin project.

Quote:


And then i should use communication protocol to be able to use the low level features

The communication protocol is a doc file. You will need to code the protocol itself
basically you will start by creating a TCP Client and sending commands to EZB.
https://stackoverflow.com/questions/19003063/ios-simple-tcp-connection-example

Quote:


Then what should i do to use the high level features?

code, code, code. Some examples:
Play video:
https://stackoverflow.com/questions/25932570/how-to-play-video-with-avplayerviewcontroller-avkit-in-swift
State Machine:
https://blog.codecentric.de/en/2016/07/handling-ios-app-states-state-machine/

Quote:


I’m sorry i’m new to all these things so i might be a little slow


I'm familiar with XCode and Xamarin, they are completely different environments one is aligned with Apple development the other one relies on Microsoft technologies.

IF you are new to software development, you have a lot to catch up before worrying with "high level" ARC features.

Whatever road you pick, you will need to master some development skills.
#6  
i can't thank you enough you have been a great help:)

Quote:

IF you are new to software development, you have a lot to catch up before worrying with "high level" ARC features.

well the thing is, i'm studying to become a computer engineer; so i took courses before to program in C++ and Java. i do have some development knowledge but it might not be efficient enough for this project. but the project deadline is on December so i believe i still have some time to learn and complete this project. btw this is my senior project so i really need to complete it in order to graduate. :D

for now i just need pointers on what should i start with; it's either xamarin or Xcode. so far; i liked Xcode interface more than xamarin. but from what you have mentioned it seems xamarin is a little easier. since it has C# source code to help implement the low level features (DLL).

but why can't i use mono sdk DLL file in xamarin project instead of using the C# source code to code it. wouldn't that save much time and effort?
PRO
Synthiam
#7  
There's a process to creating something that involves multiple technologies like this. It's first important to outline the requirement, then break it into smaller projects, and finally combine them into one. Edit the sections yourself...

Requirement
a robot that has an onboard controller (raspberry pi) and a mobile interface. The main controlling happens on the raspberry pi and remote control features are triggered from mobile interface

Smaller Projects
1) Use ARC on Windows with EZ-B v4 and get a robot to perform the features that you wish as a prototype. Use auto position, camera control, speech recognition, etc..

2) Use Mono (linux) or UWP (windows iot core) on raspberry pi to duplicate the functionality from #1

3) Create a TCP server on the raspberry pi to accept connections for remote controlling the functionality in #2

4) Use Xamarin to build a mobile app that transmits commands to the TCP server on the raspberry pi
#8  
@DJ Sures
thank you, you have simplified the process for me with those 4 points. :)

but i need a little more details.. since i already have ready projects on ARC on windows; i have completed the first point. i would like to ask you some questions regarding the second point..

Quote:

2) Use Mono (linux) or UWP (windows iot core) on raspberry pi to duplicate the functionality from #1


to duplicate the functionality from #1, do i have to use emacs editor to have .cs file and then use mcs command to generate .exe file and after that i execute it with mono?

but what do you mean exactly by duplicate? do i have to code the movements of the robot from scratch? or are there available instructions on the mono sdk that can perform those movements of the robot such as auto position, camera control, speech recognition, etc.. or is there a simpler way where i can port the whole project or some scripts of the project to the raspberry pi?

sorry for asking a lot.. *tired* and i really appreciate your help! :)
PRO
Synthiam
#9  
This is a tough answer because by wanting to run your project outside of the ARC environment on a raspberry pi will require programming. Mono is quite easy to start programming for, if you have experience programming.

In this case, you don't have experience programming yet or we wouldn't have this conversation:) But that's okay - it'll merely take some time.

One of the best options that i can think of to avoid you having to program is run ARC on the raspberry pi. This can be done via an x86 emulator, wine and the .net 4.6 framework: https://www.instructables.com/id/How-to-Set-Up-Wine-on-Raspberry-Pi-1/
#10  
@DJ Sures
great! this will be much easier for me so i can focus on programming xamarin app only. i do love programming and i wish to learn and gain more experience in it but since i have a deadline to submit this project i must take the shortest and easiest path.:D

so back to the topic, if i got the ARC on the raspberry pi and created the same projects i did in windows ARC. will i still be able to do point #3:

Quote:

3) Create a TCP server on the raspberry pi to accept connections for remote controlling the functionality in #2


and how can i create this TCP server on the raspberry pi?
PRO
USA
#11  
I'm lost...

rwn0110 first post thread 11466:
http://www.ez-robot.com/Community/Forum/Thread?threadId=11466

Quote:


is there a way to program an iPad application using Xcode to make it connect with JD


rwn0110 first post current thread:

Quote:


so i'm planning on developing an iPad application using xamarin forms to control JD through it;

OK same, as the last thread.

Quote:


and i heard to make such an application i need to use mono sdk provided in this website.

still makes sense, you can use the mono sdk dll with a Xamarin project.

Quote:


i got mono sdk and i got a raspberry pi also. but how can i make xamarin code on my windows 10 communicate with raspberry pi that is connected to its own HDMI screen, keyboard, and mouse?

the confusion starts here.... Why a Raspberry PI ?
If your goal is a mobile app connected to the EZB/JD Robot.

So why the Raspberry PI came again ?
#12  
@ptp because on the first thread DJ has told me to use xamarin. And when i started to look for the solution myself on how to make a mobile app using xamarin for JD. I saw some threads talking about mono sdk for mobile developments. And when i looked at the mono sdk page in this website; they mentioned something about using a raspberry pi. So i thought that the raspberry pi will form a connection between xamarin app created on my windows 10 laptop for ipad and the JD robot microcontroller.

So the connection is like:
Xamarin >> raspberry pi >> JD microcontroller
#13  
Hello,
So i installed exagear on my raspberry pi and installed wine version 2 but i’m having trouble installing .Net 4.6.1 framework for ARC. I tried so many ways but all of them have failed. However; i tried installing .Net 4.5 framework and it was easily installed; i don’t know what the issue with 4.6.1
I even tried installing wine version 3 instead of 2. But its installation was not easy at all and i faced many errors as well.

So is there a similar program to wine that works with ARC?
#15  
Thank you! :)
Oh and i was just wondering... if my goal is to have the ARC in raspberry pi to form a TCP connection between the raspberry pi, robot and the program i wrote in xamarin for ipad application.

Can’t i just form a TCP Connection between the ARC in my windows 10 laptop and the xamarin code i wrote for the ipad application in the same windows 10 laptop? *eek*
Will this allow me to run scripts of ARC by pushing a certain button on the ipad application for example?
#16  
@mansi1209
I honestly don’t know, i left working with it and chose another method