Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Pi-cromite V5.4.05 with documentation Post ReplyPost New Topic
<< Prev Page of 6 Next >>
Author
Message << Prev Topic | Next Topic >>
RonnS
Regular Member
Regular Member


Joined: 16 July 2015
Location: Germany
Online Status: Offline
Posts: 85
Posted: 21 September 2017 at 5:13am | IP Logged Quote RonnS

hello Matherp,

what do you think about a command to reading an analog Value ?
such is available with Python ( as a Library ) by using as an example the "EnviroHat "
they are using the ADS1015 4-channel 3.3v, analog to digital sensor (ADC)
Link


best regards Ron

PS: this would make the Picromite fully compatible to mmbasic..

Edited by RonnS on 21 September 2017 at 5:16am



Back to Top View RonnS's Profile Search for other posts by RonnS
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Online
Posts: 2338
Posted: 21 September 2017 at 7:49am | IP Logged Quote matherp

Quote:
what do you think about a command to reading an analog Value ?
such is available with Python ( as a Library ) by using as an example the "EnviroHat "
they are using the ADS1015 4-channel 3.3v, analog to digital sensor (ADC)


Great idea - I've ordered one
Back to Top View matherp's Profile Search for other posts by matherp
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Online
Posts: 2338
Posted: 22 September 2017 at 2:38pm | IP Logged Quote matherp

Please find attached a new version 5.4.09

2017-09-22_141850_Pi-cromite_Manual.pdf

2017-09-22_142121_mmbasic.zip

This version includes a new command and supporting function

FORK unix_command
FORK KILL
MM.FORK

FORK is similar to SYSTEM except that it is non-blocking and all output from the new process is sent to the null device. This allows MMBasic to run a Linux process in the background

MM.FORK returns the process ID of the forked process or zero if no process exists. Only one forked process is allowed at a time.

If this all seems rather esoteric then a simple example should illuminate things:


SetPin 3,din,pullup 'set up a pin to halt playback
Fork aplay gold.wav 'play a wav file using a standard Pi command
Do While MM.Fork 'loop while playback continues
  If(Pin(3)<>1) Then 'check the stop switch
    Fork kill 'kill the forked process
  End If
Loop


Note that the unix command does not need quotes or specific field separators but commas may be used instead of spaces if preferred. Note also that the C-library parser does not accept "-" characters in filenames as these are treated as specific to command syntax.

NB: there is a known issue with the Pi-cromite relating to use of the I2S audio. When MMBasic exits I2S audio playback will stop even if started from the Linux command line before MMBasic is run. This is caused by something internal to the PIGPIO C I/F. I have reported this to the author of PIGPIO but it is not something I can fix myself.

Back to Top View matherp's Profile Search for other posts by matherp
 
mysli
Newbie
Newbie


Joined: 27 July 2016
Location: Germany
Online Status: Offline
Posts: 11
Posted: 12 January 2018 at 7:18am | IP Logged Quote mysli

Hi *,

I just came accross MMBasic for RPi and wanted to give it a try.

I have a RPi2 and just got me the latest copy of Raspbian Lite.
I got everything nicely setup, the recent version 5.4.09 of MMBsic starts up,
but unfortunately once I am in the basic editor my keyboard is not working
anymore.

Unplugging/replugging the keyboard does not help.
On the Linux bash keyboard works just fine (after a reboot).

Does anyone has an idea? I use a standard Cherry USB keyboard.

Regards
Daniel
Back to Top View mysli's Profile Search for other posts by mysli
 
mysli
Newbie
Newbie


Joined: 27 July 2016
Location: Germany
Online Status: Offline
Posts: 11
Posted: 13 January 2018 at 5:28am | IP Logged Quote mysli

Hi *,

meanwhile I figured that actually not just the keyboard is dead,
instead the entire RPi locked up.

Under certain conditions I get a repeated post of
2018-01-12 19:24:10 gpioTick: pigpio uninitialised, call gpioInitialise()


pigpio is installed and a call of pigpiod -v seems to work.
pi@raspberrypi:~ $ sudo pigpiod -v
64
pi@raspberrypi:~ $


What is missing/wrong on my RPi?

Regards
Daniel
Back to Top View mysli's Profile Search for other posts by mysli
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Online
Posts: 2338
Posted: 13 January 2018 at 5:55am | IP Logged Quote matherp

Quote:
Under certain conditions I get a repeated post of


That happens because you have a previous version still running (two processes). You can only run one copy of MMBasic at a time and should always close it with ctrl-Z

What version of Raspbian are you running? Make sure you run the version of MMBasic that is the same.

I don't have a Pi 2 so can't confirm it works on one. I also always run headless over SSH so can't comment on the keyboard issue but I know there are others running with a local keyboard and monitor successfully.

Quote:
but unfortunately once I am in the basic editor my keyboard is not working


What do you mean? Do you get the MMBasic command prompt ">" or is the issue when you use the command EDIT?

Suggest you run the latest version rather than 5.4.09

UPDATE

One more thought - the code assumes that the Pi has an ethernet connection as it opens a socket by default. Don't know what it does if there isn't one.





Edited by matherp on 13 January 2018 at 6:35am
Back to Top View matherp's Profile Search for other posts by matherp
 
mysli
Newbie
Newbie


Joined: 27 July 2016
Location: Germany
Online Status: Offline
Posts: 11
Posted: 13 January 2018 at 7:08am | IP Logged Quote mysli

Hi *

I am absolutely sure running only one instance of MMBasic.
Also pigpiod is running in one instance only.

The Raspbian verion I run is the latest to download from www.raspberrypi.org,
Raspbian Stretch Lite, Nov. 2017

The latest MMBasic version I could find is the one from 2017-09-22.

After boot into Raspbian I run the following commands:
sudo pigpiod
sudo ./mmbasic


But no success.

Regards
Daniel
Back to Top View mysli's Profile Search for other posts by mysli
 
mysli
Newbie
Newbie


Joined: 27 July 2016
Location: Germany
Online Status: Offline
Posts: 11
Posted: 13 January 2018 at 7:24am | IP Logged Quote mysli

Hi *

one more thing: I have the Pi connected to ethernet, internet access works fine.

Regards
Daniel
Back to Top View mysli's Profile Search for other posts by mysli
 
TassyJim
Guru
Guru
Avatar

Joined: 07 August 2011
Location: Australia
Online Status: Offline
Posts: 2672
Posted: 13 January 2018 at 8:02am | IP Logged Quote TassyJim

Daniel,
Like Peter, I never use a keyboard on my Pi's so can't help there.
The latest versions are in this post:
https://www.thebackshed.com/forum/forum_posts.asp?TID=10164&PN=1

As you are using 'stretch', make sure you grab the stretch version.

The problem might also be due to the language settings of your keyboard.
(That's only a wild guess).

Jim


__________________
It all started with the ZX81....
VK7JH
http://www.c-com.com.au/MMedit.htm
Back to Top View TassyJim's Profile Search for other posts by TassyJim Visit TassyJim's Homepage
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Online
Posts: 2338
Posted: 13 January 2018 at 8:43am | IP Logged Quote matherp

Quote:
Also pigpiod is running in one instance only.


That is the issue. MMBasic doesn't use the daemon - don't run it. It is compiled with pigpio so by running the daemon you have the two copies. I've included a note to this effect in the latest version of the manual

Quote:
he latest MMBasic version I could find is the one from 2017-09-22.


I posted an update today code + manual

Edited by matherp on 13 January 2018 at 7:11pm
Back to Top View matherp's Profile Search for other posts by matherp
 
mysli
Newbie
Newbie


Joined: 27 July 2016
Location: Germany
Online Status: Offline
Posts: 11
Posted: 14 January 2018 at 3:24am | IP Logged Quote mysli

Hi Peter,

I set up Raspbian Stretch newly, got pigpio through apt-get and the latest mmbasic from yesterday.

This is what I got:

...
2018-01-13 17:20:04 gpioWrite: bad gpio (117)
2018-01-13 17:20:04 gpioSetMode: bad gpio (117)
2018-01-13 17:20:04 gpioSetMode: bad gpio (80)
Segmentation fault
pi@raspberrypi:~ $


I tried it as well headless, not HDMI no keyboard connected.

I checked the process list before (ps -e) no pigpiod running.

Seems like mmbasic doesn't like RPi Rev. 2?

Regards
Daniel
Back to Top View mysli's Profile Search for other posts by mysli
 
matherp
Guru
Guru


Joined: 11 December 2012
Location: United Kingdom
Online Status: Online
Posts: 2338
Posted: 14 January 2018 at 4:15am | IP Logged Quote matherp

Quote:
got pigpio through apt-get


First try cleaning up from previous version of MMBasic

You must

rm .options


and then rerun

If that doesn't work please get pigpio from here and install as per the instructions.

Back to Top View matherp's Profile Search for other posts by matherp
 


<< Prev Page of 6 Next >>
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1563 seconds.
Privacy Policy     Process times : 0.05, 0, 0, 0.11