Main Site Documentation

Serial Output


#1

Hi,
i got a little Question.

Befor i got a Fez Domino, i used a Arduino as Input Device for a home automation software. I used it as datalogger for reading a din-rail powermeter. So the Arduino reads the data and sends it over the virtual serial port to my pc. So now i woult like to do this with my new fez domino. But how can i communicate with my pc? The Fez Domino didnt creats a virtual serial port. But the VisualStudio and the MSDepoy Tool can read the Debug Output. Can i read the Debug Ouput with C# on the Pc side? The software on the pc side is written in c#.

Thanks and sorry for my bad english.
Greets
Henning


#2

The connection to your PC is for debugging (which you do not have on arduino) and not a virtual serial port.

FEZ Domino has 3 serial ports so you can pick anyone you like and connect a USB<->serial cable…

Or use the RS232 shield and then you can connect a serial cable to your PC…

Or connect a USB<->serial cable to the USB host on domino and then connect that to your PC serial port…

or use the bluetooth component to make a bluetooth connection and transfer that data that way…

there is really many ways to do this so pick the one you like best :smiley:

Also, you can change the USB client interface to become a virtual serial port (or many other things) I highly do not recommend you try that for beginners


#3

Hi,
thanks for the quick reply.
I was hopping that i can use the mini Usb Port for powering and communicate with the pc.
I think i use my old arduino as usb-serial converter, as i read it in another thread here.

Thanks
Henning


#4

Hi,
I have one more small question about serial communication.
I try to transfer a text, from C# on the PC side to the domino. The text is 1024 bytes long. But on the domino side always be only 256 bytes received.
Can i configure this somewhere or do i have to split the text in 256 byte blocks?

Thanks
Henning


#5

it’s your code :slight_smile:

you need to remember Fez doesn’t have unlimited memory. You should be handling your data in “chunks” somehow. There’s nothing I can think of that would FORCE you to have only 256 char blocks, so if you want to have a block of 1024 chars you can - but you need to handle it properly!

Show us your code


#6

Send 100 bytes then wait for an ok from fez before sending more


#7

Hi,
Thanks that works great, a little bit slow but okay.

But i have another question and i dont want to start a extra thread for that.

Is there any trick to transfer the DateTime from my pc to the fez?

When i send DateTime.Now.Ticks.ToString() from my pc to the fez and i parse it there as long, then i have exactly the same number in it.
But when i try to do new DateTime(LongWithTheTicks) then i got an exception:
System.ArgumentOutOfRangeException Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.

I found out that the Ticks of my pc are 634154061848395921 and with the same Date and Time on the fez it is 129242902200000000.

How can i convert my pc Ticks to that?

Thanks
Henning


#8

It is always better to start new thread so others can benefit from your question.

PCs and embedded system are from 2 separate world. Yes the NETMF helps in bringing them closer but they are still different.

Whenever you run into something similar you want to think of a way where you put the load on the PC (even use “unsafe” code) to generate something that is easily passable by the device.

I would try to figure out the ticks on NETMF and then convert the ticks from your PC to match the device then send to the device.


#9

Thanks for the reply.
I found a way to set the time.

My “trick” is to get the milliseconds of the timespan from 01.01.1900 00:00:00:00 to Now and send it to the fez and there i add them to the same MinValue.

Thanks, and nexttime i will start a new thread :wink:
Henning