Home
JAQForum Ver 20.06
Log In or Join  
Active Topics
Local Time 19:13 27 Apr 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Pi-cromite V5.4.05 with documentation

     Page 3 of 4    
Author Message
astro1
Regular Member

Joined: 26/06/2016
Location: Australia
Posts: 51
Posted: 07:51pm 18 Sep 2017
Copy link to clipboard 
Print this post

Hi Peter,
Using an I2S DAC with MMBasic works the first time after starting the PI and running mmbasic. After quiting mmbasic the sound no longer works for mmbasic and the PI.
Running radio and airplay and mmbasic. Sound works until quiting mmbasic. Then running mmbasic, no sound at all.

Thanks.
 
WhiteWizzard
Guru

Joined: 05/04/2013
Location: United Kingdom
Posts: 2794
Posted: 08:46pm 18 Sep 2017
Copy link to clipboard 
Print this post

@astro1

Out of interest, are you setting the OPTION PIN MASK (can't remember the exact command) for the I2S pins again after 'restarting' MMBASIC?

EDIT: Just found it: OPTION PINS &HA400000800

Edited by WhiteWizzard 2017-09-20
For everything Micromite visit micromite.org

Direct Email: whitewizzard@micromite.o
 
Peter63
Newbie

Joined: 28/07/2017
Location: Sweden
Posts: 14
Posted: 09:10pm 18 Sep 2017
Copy link to clipboard 
Print this post

Hi, matherp

I missing a way to send in a default string to the input -command?


s$="default string to be edit or not"
input"Edit string";s$
print s$






 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 11:17pm 18 Sep 2017
Copy link to clipboard 
Print this post

  Peter63 said   Hi, matherp

I missing a way to send in a default string to the input -command?


s$="default string to be edit or not"
input"Edit string";s$
print s$








hi Peter,

you can use the GUI Textbox or GUI Numberbox for an input, see the MicromitePlus manual

regards Ron
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 11:46pm 18 Sep 2017
Copy link to clipboard 
Print this post

  Quote  I missing a way to send in a default string to the input -command?



input "Edit string";s$
if s$="" then s$="default string to be edit or not"
print s$


  Quote  Using an I2S DAC with MMBasic works the first time after starting the PI and running mmbasic. After quiting mmbasic the sound no longer works for mmbasic and the PI.


This is a bug in the way the Pi-cromite code exits where it doesn't respect OPTION PINS. Please try the attached fix (untested)

2017-09-19_094632_mmbasic.zip Edited by matherp 2017-09-20
 
astro1
Regular Member

Joined: 26/06/2016
Location: Australia
Posts: 51
Posted: 02:10am 19 Sep 2017
Copy link to clipboard 
Print this post

Same issue using latest.

seeing this after quitting mmbasic.
./mmbasic: /lib/arm-linux-gnueabihf/libtinfo.so.5: no version information available (required by ./mmbasic)
./mmbasic: /lib/arm-linux-gnueabihf/libncurses.so.5: no version information available (required by ./mmbasic)
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 02:33am 19 Sep 2017
Copy link to clipboard 
Print this post

  Quote  seeing this after quitting mmbasic.


Don't know why you are seeing the message but suspect it is benign. ncurses is the package I compile with that manages the console I/O. To get rid of the message you can install it:

sudo apt-get install libncurses5-dev


I'm unable to test I2S DAC at the moment as away from home - will try to look at it at the weekend
 
astro1
Regular Member

Joined: 26/06/2016
Location: Australia
Posts: 51
Posted: 12:40pm 19 Sep 2017
Copy link to clipboard 
Print this post

I only see the libncurses message with the latest fix (file size 330KB), size of 5.4.08 is 332KB.
Just FYI.
 
RonnS
Senior Member

Joined: 16/07/2015
Location: Germany
Posts: 120
Posted: 07:13pm 20 Sep 2017
Copy link to clipboard 
Print this post

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 2017-09-22
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 09:49pm 20 Sep 2017
Copy link to clipboard 
Print this post

  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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 04:38am 22 Sep 2017
Copy link to clipboard 
Print this post

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.

 
mysli
Newbie

Joined: 27/07/2016
Location: Germany
Posts: 11
Posted: 09:18pm 11 Jan 2018
Copy link to clipboard 
Print this post

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
 
mysli
Newbie

Joined: 27/07/2016
Location: Germany
Posts: 11
Posted: 07:28pm 12 Jan 2018
Copy link to clipboard 
Print this post

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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 07:55pm 12 Jan 2018
Copy link to clipboard 
Print this post

  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 2018-01-14
 
mysli
Newbie

Joined: 27/07/2016
Location: Germany
Posts: 11
Posted: 09:08pm 12 Jan 2018
Copy link to clipboard 
Print this post

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
 
mysli
Newbie

Joined: 27/07/2016
Location: Germany
Posts: 11
Posted: 09:24pm 12 Jan 2018
Copy link to clipboard 
Print this post

Hi *

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

Regards
Daniel
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 5905
Posted: 10:02pm 12 Jan 2018
Copy link to clipboard 
Print this post

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

VK7JH
MMedit   MMBasic Help
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 10:43pm 12 Jan 2018
Copy link to clipboard 
Print this post

  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 + manualEdited by matherp 2018-01-14
 
mysli
Newbie

Joined: 27/07/2016
Location: Germany
Posts: 11
Posted: 05:24pm 13 Jan 2018
Copy link to clipboard 
Print this post

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
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 8582
Posted: 06:15pm 13 Jan 2018
Copy link to clipboard 
Print this post

  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.

 
     Page 3 of 4    
Print this page
© JAQ Software 2024