WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: remote desktop for piCore  (Read 7364 times)

Offline dbasberg

  • Newbie
  • *
  • Posts: 8
remote desktop for piCore
« on: November 01, 2016, 06:02:28 PM »
I have been using my pi with rdp.  I can use the pi desktop from anywhere by net...great.  I develop embedded systems and have had working systems go belly up due to SD flash wear out.  In exploring how to handle that, I came across piCore and that looks promising.  I want to do 'home automation' with esp8266, Arduinos, and PIs in a networked IoT system.  I put piCore 7 image on an SD card and immediately could talk to my PI on SSH...great.  Next step is headless desktop access.  I was using xrdp with Raspbian.  What should be my approach on the piCore system?  Are people using RDP or something else to achieve this?

Eventually, I hope to use the PI with MQTT, MODBUS, and perhaps, Javascript node.js or node-red.  Is this being done by others?  My system will be controlling a solar power system, HVAC, security, lighting, and appliances.  So, reliability has to be very good.  That is why I can not accept the flash wear problem which can manifest in so many ways.

I am very interested in piCore as part of my solution.
Thanks, Doug
Douglas S. Basberg, MSEE, PE
embedded controls consultant
HAM call N8VY

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: remote desktop for piCore
« Reply #1 on: November 01, 2016, 11:13:10 PM »
I have remote piCore gadgets, one over 100km away.
They all run data plotting webservers using busybox-httpd.tcz

But for remote editing/coding I use a number of tools.
Superputty on Windows to ssh into the networked Pi.
piCore comes with MC, Midnight Commander, run that local or remote to look, view, edit files.

Filezilla allows you to remote copy files but MC does too, just not drop and drag.
Don't forget to filetool.sh -b before reboot ;)

All my gadgets send daily "OK" emails that contain their ipaddress, that so I don't lose track of them.

Standard piCore does not come with a desktop, so remote desktop won't work as that's X11 based.
You can install a desktop by- tce-load -wi TC.tcz
But I have not used the desktop much until recently as I start turning my Pi3/piCore into a development box.
It is much faster on a Pi3 ;D

For anything remote HTML5/busybox-httpd just makes more sense.
Most of my coding is done in shell script with maybe micropython for speed on GPIO stuff.





Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: remote desktop for piCore
« Reply #2 on: November 02, 2016, 01:14:50 AM »
Hi Doug

welcome on board. First of all, install piCore-8.0 instead of the old 7.x Next install TC.tcz from repo to have a graphical environment. For remote access, use x11vnc from repo and install a VNC client on your host like TigerVNC or UltraVNC.

Béla
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: remote desktop for piCore
« Reply #3 on: November 02, 2016, 05:00:05 AM »
I really need to catch up.
VNC works?
Lots to play with on the weekend.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: remote desktop for piCore
« Reply #4 on: November 02, 2016, 05:04:57 AM »
I really need to catch up.
VNC works?
Lots to play with on the weekend.

Yes, I'm using VNC on a WIN10 machine to work with Xfce4 desktop on RPi3 :)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11049
Re: remote desktop for piCore
« Reply #5 on: November 02, 2016, 07:52:17 AM »
Quote
So, reliability has to be very good

Using JS at all, node or otherwise, is not wise from a reliability standpoint.
The only barriers that can stop you are the ones you create yourself.

Offline dbasberg

  • Newbie
  • *
  • Posts: 8
Re: remote desktop for piCore
« Reply #6 on: November 02, 2016, 05:56:19 PM »
Hi Doug

welcome on board. First of all, install piCore-8.0 instead of the old 7.x Next install TC.tcz from repo to have a graphical environment. For remote access, use x11vnc from repo and install a VNC client on your host like TigerVNC or UltraVNC.

Béla

Thanks Bela 8).  The TC.tcz and startx got me into the GUI and I added the extension for vnc (x11vnc) and tried to access it from a Win10 PC with tightvnc and then ultravnc.  I got the message that the server rejected the client.  Is there a config file or something I should be setting up on the RPI?  The PC assumes ports 5800 or 5900 is that good for the RPI?
73, Doug
Douglas S. Basberg, MSEE, PE
embedded controls consultant
HAM call N8VY

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1260
Re: remote desktop for piCore
« Reply #7 on: November 02, 2016, 10:27:37 PM »



Thanks Bela 8).  The TC.tcz and startx got me into the GUI and I added the extension for vnc (x11vnc) and tried to access it from a Win10 PC with tightvnc and then ultravnc.  I got the message that the server rejected the client.  Is there a config file or something I should be setting up on the RPI?  The PC assumes ports 5800 or 5900 is that good for the RPI?
73, Doug

Did you start the vncserver?   You will likely need to set a vnc password too.
« Last Edit: November 02, 2016, 10:31:49 PM by Paul_123 »

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: remote desktop for piCore
« Reply #8 on: November 03, 2016, 12:34:43 AM »
Just start x11vnc. It will wait for an incoming session on port 5900, no password. No configuration file or command line parameters needed to get it up and running first time. Server has large number of options, e.g. password setup however.

It is sharing the existing screen. When VNC session closed by client server exits.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: remote desktop for piCore
« Reply #9 on: November 03, 2016, 01:17:36 AM »

Eventually, I hope to use the PI with MQTT, MODBUS, and perhaps, Javascript node.js or node-red.  Is this being done by others?  My system will be controlling a solar power system, HVAC, security, lighting, and appliances.  So, reliability has to be very good.  That is why I can not accept the flash wear problem which can manifest in so many ways.


I would not trust in ordinary Raspberry Pi to mange security, solar, etc. not because of piCore but hardware including SD card. Forget brand names, e.g. I had Samsung 16GB Class 10 cards dying in 1-3 month in RPi. Go for a CM (Compute Module) with eMMC. And I would use separate modules for security and solar probably with an option to run services on any modules if one fails.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline dbasberg

  • Newbie
  • *
  • Posts: 8
Re: remote desktop for piCore
« Reply #10 on: November 03, 2016, 11:58:05 AM »

Eventually, I hope to use the PI with MQTT, MODBUS, and perhaps, Javascript node.js or node-red.  Is this being done by others?  My system will be controlling a solar power system, HVAC, security, lighting, and appliances.  So, reliability has to be very good.  That is why I can not accept the flash wear problem which can manifest in so many ways.


I would not trust in ordinary Raspberry Pi to mange security, solar, etc. not because of piCore but hardware including SD card. Forget brand names, e.g. I had Samsung 16GB Class 10 cards dying in 1-3 month in RPi. Go for a CM (Compute Module) with eMMC. And I would use separate modules for security and solar probably with an option to run services on any modules if one fails.

I appreciate this advice Bela.  It will take me a while to read up on this and I will.  I appreciate the idea of redundancy between two or more compute engines.  Should handle anything but an EMP pulse.  Then I will be relying on our homestead 10 acres (4 hectares) and wood burning stove (low tech life style). ;D
Douglas S. Basberg, MSEE, PE
embedded controls consultant
HAM call N8VY

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: remote desktop for piCore
« Reply #11 on: November 03, 2016, 11:08:44 PM »
Pi's seem to be fine for monitoring and data logging at room temperature.
I have had great reliability.

Bela is right when it comes to control, the SD card is the weakest link after a good power supply.
Which is why I use piCore as it only reads the SD card for the OS, if there is a write failure I only lose the log data.

Not convinced about the CM yet, it has a large edge connector with lots of pins, compared to 9 on the SD card.
Could always boot from SD, run from USB stick or network.
There is also suppliers of industrial rated SD cards.

At home I have had Pi's running security cameras for years.
SD card do need swapping every 1/2 year or so, but they are writing every few minutes.
If I get a fault I check card first.
Best camera I have writes to external HD.

Really the cost of a Pi, one for every system is easy to justify and means less hassle if one goes down you don't crash everything.
ModbusTCP is not that hard, made a server with some micropython code using sockets.

The only JS I have is in the HTML5 webpage and does the plotting of the csv data log files.
All the rest is shell script, text/html files. Biggest shell file is 2.9K, shell on a 1GHz cpu is not that slow.
The webserver is busybox-httpd.tcz which is the only extra tcz I need to install on top of the basic piCore OS.

You could set up a piCore server that boots the other Pi's.
Swap bad Pi out, reboot and download the OS/App from the server.

MQTT/Modbus is a bit dated, I just run webservers with cgi if I need buttons/GPIO.

SD cards that fail on Raspbian I recycle to piCore, they still work fine most of the time :o
Micro SD cards are tougher than SD cards, I have hard lots of SD cards fall apart on the older Pi's.
SD card readers fail too, they seem to wear out.

Try to avoid the Pi3, it is very sensitive to temperature and voltage, fine for desktop with heatsink.
B+ have plenty of grunt running headless. The B+ seem to be the best of them all, old B's with linear regs not as good.



Offline dbasberg

  • Newbie
  • *
  • Posts: 8
Re: remote desktop for piCore
« Reply #12 on: November 04, 2016, 12:38:15 PM »
Thank you so much Gavin!  You have really given me a lot of useful information on how to proceed.

After Bela mentioned the Compute Modules(CM), I read a bit about them and checked what they cost in a development kit so I would have access to the pins.  Two things I found.  The price for an CM1 was $130 US and the version with PI3 core CM3 was not found for sale.  They did claim an industrial temperature range.  I appreciate your advice to use the B+ and not the PI3 for extended temperature operation.  Maybe the CM3 can not meet temp requirements?

While I am experimenting with piCore on the desktop, I will use two PI3s for their speed.  When I deploy into the cruel world, I will use B+ as you advise.  MQTT has a small footprint and goes well with esp8266 modules as well as PIs.  I was thinking using WoT was more overhead to support.  Either in the cloud, or on a local PC with hard disks, or on a USB hard drive hooked to a PI, I need somewhere reliable to store much data from many nodes at a rate in minutes (10?).  MQTT can ship the data and provide command messages, so it should be adequate.  I have versions for esp8266, PI, PC, and cloud.  I was worried about overhead of being a web server on each device.

Again, I appreciate all the valuable info you shared and look forward to further discussions. 8)
Doug
Douglas S. Basberg, MSEE, PE
embedded controls consultant
HAM call N8VY

Offline gavinmc42

  • Sr. Member
  • ****
  • Posts: 301
Re: remote desktop for piCore
« Reply #13 on: November 04, 2016, 10:08:12 PM »
Doug,  welcome to the best IoT Pi Linux OS forum 8)

On the B+'s mine max the CPU to <6% when updating the webpage.
This is once a minute as that is my data read rate.
The rest of the time <2%, not an accurate measure of CPU usage just an indicator.

Rev 1.2 of Pi2 has the same BCM2837 but under clocked to 900MHz.
Under clocking a Pi 3 should help with heat.
But when you need Raspbian desktop and chromium every bit counts.

Check the Browser post for my venture into TC/X11 desktop with piCore.
piCore/X11 is much faster than Raspbian on a 3, so I am seeing if it usable as a development box.
Midori when in repo should help, Dillo3 is ok for text pages.
Bela has put my favorite editor Geany in now :-*

A lot of stuff gets installed for X11, don't need it for remote if you can put up with the retro look of MC.
MC is a bit of a pain for developing but ok for fixing things, mostly it is copy and modify now.

HTML5 can be developed on PC/Linux/Pi.
Filezilla is great for copying the files to the remote box.
Most of the setup is done in the /opt/bootsync file.

Scripts are run with cron and watch.
Cron for slow scheduled stuff, watch for scanning  GPIO pins for button presses.
Micropython for toggling GPIO for buzzers/sound.

When I first started with piCore I was behind a firewall and installing tcz's was nearly impossible.
So I started seeing what I could do with just the basic install. A lot more than I expected it turned out.

Even did the web page plotting with shell generated inline SVG :o
But life is too short to reinvent auto scaling graphs, so i used a JS library.
http://dygraphs.com/
It plots csv files better than Google charts too.
No data base needed just daily csv files.

Old Linux stuff like Shell scripting with Awk, Sed works fast enough.
Busybox has lots of useful stuff in it.
I use shell script and netcat (nc) to send emails for alarms and status.

Because piCore runs from ram, reading/writing ram files is fast.
I can get one bit of script to write text into a file subject.txt, the message into message.txt etc.
Then another shell script reads the subject/message and inserts then into another preformatted string to a email file etc.
Basically I am using files as global variables.

As for a central storage, not convinced yet.
The piCore OS does not take up much room on 8GB micro SD's,
I use the rest to make a third partition /data/logs and symlink it to home/tc/www/logs so busybox-httpd webserver can find the data.
2 years of data logging still have >90% of 7+GB free, have not replaced sd card yet.
Have one old model A that's 4 years old still running really old Raspbian OS/python code.
Because it has no network it never writes and does not log either.

This means I have local storage and data plotting on each Pi.
Later on I can always copy files to a central file server, still need to figure this out.
I think the industry is still traditional and wants the data in one place.

I have lots of wasted cpu cycles, so i am looking at deep learning and data/trend prediction running on each Pi.

Example - I monitor a bunch of fridges, I can check and analyze the time between compressor cycles.
This is obvious from the temperature plots, i can tell when the door opens and if the room aircon is working etc.
I should also be able to tell if the cycle times are getting shorter, this would indicate coolant leak.
I can have one Pi monitor 4 fridges, more if I multiplex.

Predictive maintenance.
Sensors are getting smarter but once they have Pi's in them it becomes game changing.

Remote desktop is not so important as remote data viewing, which HTML5 stuff does fine.
Next step WebGL for plotting trends over day/months/years?
But that requires someone to look at the data and make a judgment - 1, 5, 20, 500 fridges ::)
Better if we get the sensor to make it's own decision and send a message, " hey,  I think I am about to fail" or "someone left the door open", "the cleaners unplugged me so they could vacuum".

Now if you want to do real time control with Pi's with timing loops in1/100sec, nearly possible but the Linux OS gets in the way.
Which is why I spend lots of time relearning Pascal for Ultibo.
Or just off load it to a Arduino or my preferred chips - PSoC's.
PSoC's are useful as they are programmed via I2C, the same I2C I use to talk to them by the Pi.

The Arduino IDE runs on Raspbian and even does the Adafruit LoRa Feathers which are great for long range RF sensing.


Offline dbasberg

  • Newbie
  • *
  • Posts: 8
Re: remote desktop for piCore
« Reply #14 on: November 26, 2016, 11:15:41 AM »
Thank you Gavin;

You have given me dozens of ideas to explore here and I will. 

My 10 acre homestead has lots of automation possibilities.  I have a greenhouse with solar powered automation for water circulation, vent control, lots of data logging, light control, and a weather station.  I have a rather incomplete automation setup with much more to do.  The barn has animals (chickens and rabbits) with esp8266 control of lights and temp/humid reporting and security motion, cameras, siren.  The house has solar power for HAM radio, frig and freezers, so I do not lose my frozen food from garden and animals.  Shot a buck on 11/23/16 and now it is butchered and in the freezers.

Just decided to drop Directv and use over-the-air (36 channels here) with a Hauppage 4 tuner PCIe board recording shows automatically.  I use Kodi hacked onto Fire TV to show my photos, music, home videos, and recorded TV on our not smart HD flat screen.  Kodi also works on my PCs, iPhone, Winbook.  I am augmenting content by using Hulu and Amazon Prime.  Many people are using PIs to do this, but so far, I am using a PC with a 2TB HD to capture the shows.

I am retired, but busy.  I split my time among farm tasks, HAM radio, electronic projects, automation projects, woodworking, metal working, equipment maintenance, and occasionally social events.

I appreciate the help I am getting on the forum and especially your input. 8) 
Douglas S. Basberg, MSEE, PE
embedded controls consultant
HAM call N8VY