Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 07:11 02 Aug 2025 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.04.21: Serial Console

     Page 2 of 2    
Author Message
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 08:32am 14 Nov 2018
Copy link to clipboard 
Print this post

  Quote  Quote:
however I find i cannot transfer programs as XMODEM RECEIVE command is not known? Is this correct ore am I missing something?


It never made sense to include it before but does now so I'll put it into the next release.


Hi Peter, Have you had time to look into this just yet? Sorry to ask , I have tried ver 21 and it doesn't seem to have changed .

Cheers Mike.
Codenquilts
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:36am 15 Nov 2018
Copy link to clipboard 
Print this post

  Quote  Have you had time to look into this just yet?


Hadn't done, but have now

Please find attached V5.04.25 for Stretch:

2018-11-15_224828_mmbasicstretch.zip

and for Jessie:

2018-11-15_224843_mmbasicjessie.zip

This version includes Geoff's additional GUI controls and various MMBasic bug fixes. In addition XMODEM is implemented as per MX470 (send and receive including file transfer to/from disk). This is only enabled when using a serial console (OPTION SERIAL CONSOLE n) as WINSCP is much faster when you have an IP console connection.

Note: The MMEDit file manager works perfectly with this release however the "Load and Run" button gives an error after the transfer - this is incorrect as the transfer has completed correctly and you can connect to the console and run the program as normal. There is no issue when using Teraterm. Jim: any ideas?
Edited by matherp 2018-11-16
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:50am 16 Nov 2018
Copy link to clipboard 
Print this post

Still no success with 'load and run' but I am working on it.
At the end of the transfer I receive "Error: Invalid character: 1"

I have added a USB-TTL adaptor to the Pi and connected it to COM1.
That way I can use ser2net to connect to mmbasic in terminal mode over TCPIP.
Easier for me than running a serial cable.

I have found a problem with AUTOSAVE.
AUTOSAVE is ended with ctrl-Z but that kicks you right out of MMBasic.
Is there an alternative used to end AUTOSAVE?

Jim

VK7JH
MMedit
 
MikeO
Senior Member

Joined: 11/09/2011
Location: Australia
Posts: 275
Posted: 02:37am 16 Nov 2018
Copy link to clipboard 
Print this post

Peter , thanks for the Xmodem upload function.

Hi Jim, don't know if it helps or any clue but I tried the Micromite Console program ver 0.936
and I got this reply after the "To MM" upload from the editor. $ instead of 1
> xmodem receive
Saved 2518 bytes
Error: Invalid character: $

If you use a file upload from the Console of this Program "File To Micro" the error is a little different.

xmodem receive
Saved 2518 bytes
Error: Expected a number


I normally use the Teraterm Macro "crunched" upload and that also gives the "Error: Invalid character: $"

As Peter says though, In all cases the upload is successful however.

Mike

Edit: I have found the Invalid Char is not fixed , it varies, I just got
> XMODEM RECEIVE
Saved 305 bytes
Error: Invalid character: ,

Mike

Edited by MikeO 2018-11-17
Codenquilts
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 02:51am 16 Nov 2018
Copy link to clipboard 
Print this post

I will try to work out how to ignore the error message.

My usual upload method is AUTOSAVE from 'load' in MMChat.
I have added a setting to use ctrl-C for PiCromite files and that seems to work.

I have another 'problem'

The PI starts sending double CRs which results in double spacing.



I still haven't worked out what triggers it.

Jim
VK7JH
MMedit
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 05:17am 16 Nov 2018
Copy link to clipboard 
Print this post

An update for MMEdit to address the XMODEM problem.
You still get the error message but MMEdit keeps going instead of throwing a hissy fit.

I have also made some changes to allow using AUTOSAVE ('Load' in the Chat window)
To do this you need to select the PiCromite syntax file so MMEdit knows to use ctrl-C instead of ctrl-Z

I have also made a few changes to fix a few errors caused by the extra CRs.

You need to place the TKN file into the program folder and the DTA file into the data folder.

2018-11-16_151710_MMedit.zip

Edit:

I tried using AUTO instead of AUTOSAVE but that came up with 'Error: Unknown command'

If you are using MMBasic via a serial port, exiting out of MMBasic can be hard to recover from. Perhaps a 'Confirm exit' would be useful to catch the accidental ctrl-Z

Jim
Edited by TassyJim 2018-11-17
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 12:31pm 16 Nov 2018
Copy link to clipboard 
Print this post

Jim and Mike

Many thanks for your diagnostic efforts. They helped me to find the spurious character and now I get no error using XModem download from MMEdit .

Attached latest binary for Stretch

2018-11-16_222927_mmbasicstretch.zip

and for Jessie

2018-11-16_222943_mmbasicstretch.zip
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 08:12pm 16 Nov 2018
Copy link to clipboard 
Print this post

Peter,
Both files are the same.
VK7JH
MMedit
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 10:53pm 16 Nov 2018
Copy link to clipboard 
Print this post

Oops

2018-11-17_085241_mmbasicjessie.zip

2018-11-17_085257_mmbasicstetch.zip

Is anyone still using Jessie? be good to dump it.
 
TassyJim

Guru

Joined: 07/08/2011
Location: Australia
Posts: 6283
Posted: 12:07am 17 Nov 2018
Copy link to clipboard 
Print this post

  matherp said   Oops

Is anyone still using Jessie? be good to dump it.

I upgraded my 'play' unit to stretch yesterday.

Still using Jessie on some in service units but they wont get MMBasic in the foreseeable future so I can live without the Jessie build.

Jim

VK7JH
MMedit
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:58pm 21 Nov 2018
Copy link to clipboard 
Print this post

Matherp

I installed the latest version of Picromite tonight but I'm getting a weird error



I don't have that line of code in my program

I had no issues with the previous version I was using, although it was probably 2 - 3 versions ago, I didn't upgrade when you included the code for graphs at first

Any ideas?

I've sent you the full code by message as it contains my logins for the various weather stationsEdited by lew247 2018-11-23
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 07:27am 22 Nov 2018
Copy link to clipboard 
Print this post

That line is in the code you sent me in the subroutine "getlimits". Geoff has tightened up array checking in the latest version of MMBasic and I implemented the changes in the Pi-cromite.Edited by matherp 2018-11-23
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 12:40pm 22 Nov 2018
Copy link to clipboard 
Print this post

  matherp said   That get limits is from your code for "triangles" and moving pointers.


[code]
'The following values are not scaled here as they are scaled when they are drawn
'Otherwise they wil be scaled twice, so set using hres=800, vres=480
const pivot_x=323 'specify where the centre of the dial is located
const pivot_y=405
const radius=54 'specify the radius of the dial
const side_length=11 'specify the size of the equilateral triangle pointer
'define the points that make up the triangle relative to a pivot at 0,0
const x0=0
const x1=-side_length/2
const x2=side_length/2
const y0=-radius
const y1=-radius+side_length*cos(rad(30))
const y2=y1
dim integer angle, X, Y, W, H
dim integer xx0,xx1,xx2,yy0,yy1,yy2 'variables holding the vertices of the triangle relative to its pivot
dim integer pxx0,pxx1,pxx2,pyy0,pyy1,pyy2 'variables holding the absolute vertices of the triangle
'note radius and other non H or V values will need to be manually changed


Sub moveto(angle As integer)
Local integer xs=x, ys=y, ws=w, hs=h
rotatetriangle(angle,0,radius,x0,y0,x1,y1,x2,y2)
pxx0=xx0+pivot_x
pyy0=yy0+pivot_y-radius
pxx1=xx1+pivot_x
pyy1=yy1+pivot_y-radius
pxx2=xx2+pivot_x
pyy2=yy2+pivot_y-radius
getlimits(x, y, w, h)
Triangle pxx0, pyy0, pxx1, pyy1, pxx2, pyy2, RGB(215,255,119), RGB(215,255,119) 'COLOUR OF TRIANGLE
End Sub

Sub getlimits(x As integer, y As integer, w As integer, h As integer)
Local integer i,max_x=0,min_x=MM.HRes,max_y=0,min_y=MM.VRes
If(pxx0(i)>max_x)Then max_x=pxx0(i)
If(pxx1(i)>max_x)Then max_x=pxx1(i)
If(pxx2(i)>max_x)Then max_x=pxx2(i)
If(pxx0(i)<min_x)Then min_x=pxx0(i)
If(pxx1(i)<min_x)Then min_x=pxx1(i)
If(pxx2(i)<min_x)Then min_x=pxx2(i)
If(pyy0(i)>max_y)Then max_y=pyy0(i)
If(pyy1(i)>max_y)Then max_y=pyy1(i)
If(pyy2(i)>max_y)Then max_y=pyy2(i)
If(pyy0(i)<min_y)Then min_y=pyy0(i)
If(pyy1(i)<min_y)Then min_y=pyy1(i)
If(pyy2(i)<min_y)Then min_y=pyy2(i)
x=min_x
y=min_y
w=max_x-min_x+2
h=max_y-min_y+2
End Sub
'
' Simple trig to rotate the vertices of a triangle
' specified as x0,y0,x1,y1,x2,x2 relative to coordinate 0,0
' by the angle specified
' and then translate them about the supplied real centre x,y
' the calculated coordinates are then placed into element n of a set of coordinate arrays
'
Sub rotatetriangle(angle As float, x As integer, y As integer, x0 As integer, y0 As integer, x1 As integer, y1 As integer, x2 As integer, y2 As integer)
Local float sine=Sin(Rad(angle)),cosine=Cos(Rad(angle))
Local integer x0a,y0a,x1a,y1a,x2a,y2a
x0a= x0*cosine - y0 * sine + x
y0a= y0*cosine + x0 * sine + y
x1a= x1*cosine - y1 * sine + x
y1a= y1*cosine + x1 * sine + y
x2a= x2*cosine - y2 * sine + x
y2a= y2*cosine + x2 * sine + y
xx0=x0a
yy0=y0a
xx1=x1a
yy1=y1a
xx2=x2a
yy2=y2a
End Sub[/code][/quote]

I can't see anything wrong with them
Edited by lew247 2018-11-23
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4044
Posted: 01:38pm 22 Nov 2018
Copy link to clipboard 
Print this post

Two thoughts

1. pxx0 appears to be used as an array but declared not as an array
2. i has not been set.

I suppose i may default to zero but that is terrible coding even if so.

JohnEdited by JohnS 2018-11-23
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 01:53pm 22 Nov 2018
Copy link to clipboard 
Print this post

  JohnS said   Two thoughts

1. pxx0 appears to be used as an array but declared not as an array
2. i has not been set.

I suppose i may default to zero but that is terrible coding even if so.

John


While it may be "terrible coding" I have no idea how you declare something as an array
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 06:09pm 22 Nov 2018
Copy link to clipboard 
Print this post

  Quote  1. pxx0 appears to be used as an array but declared not as an array


This is the "bug" that Geoff fixed. Previously simple variables could be used with an index without a bug being generated.

If pxx0 etc are simple variables then just get rid of the index brackets from the subroutine
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:00pm 22 Nov 2018
Copy link to clipboard 
Print this post

Thanks Peter
I've got it working again now
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 03:54pm 26 Nov 2018
Copy link to clipboard 
Print this post

I downloaded 2018-11-17_085257_mmbasicstetch.zip and put mmbasic on a raspberry pi zero w with latest raspbian stretch lite (installed yesterday). When I run "sudo mmbasic", I get "SigHandler: Unhandled signal 11, terminating", and a return to the "$" prompt. I'm connected to the pi headlessly over wifi with puTTY.

At this point, what I type does not appear, but if I type a linux command and hit enter, it runs. I have to reboot to get typing at the linux command line to appear.

I'm not running pigpiod, as shown by "ps -A -f | grep pigp". I followed instructions and made pigpiod v68--location shown by "which pigpiod".

I could not cut and paste from the puTTY window after the SigHandler error. There is a screen shot below.

What do I need to do?




PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 10315
Posted: 05:31pm 26 Nov 2018
Copy link to clipboard 
Print this post

  Quote  I get "SigHandler: Unhandled signal 11, terminating"


Things to try:
make sure stretch is fully updated
sudo apt-get update
sudo apt-get upgrade
Try "rm .options" before running mmbasic

  Quote  I have to reboot to get typing at the linux command line to appear.


Just disconnect putty and re-connect and you will get back to normal. This issue is that ncurses has taken over control of the terminal

UPDATE

I had a jessie pi-zero w that needed updating so I did a complete new install

downloaded Stretch-lite image
burned to sd card using win32diskmanager
created wpa_supplicant.conf with my wifi details and saved on the boot disk
created "ssh" and saved on the boot disk
sd card into pi-zero and power on
found ip address of pi (wifi connect successful)
connected using teraterm over ip (SSH successful)
sudo apt-get update
sudo apt-get upgrade
wget abyz.me.uk/rpi/pigpio/pigpio.tar
tar xf pigpio.tar
cd PIGPIO
make
sudo make install
cd ..
downloaded 2018-11-17_085257_mmbasicstetch.zip from TBS
extract mmbasic
copy to pi using winscp
chmod +x mmbasic
sudo ./mmbasic

All runs perfectly

Edited by matherp 2018-11-28
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3378
Posted: 12:45am 27 Nov 2018
Copy link to clipboard 
Print this post

  matherp said  ... so I did a complete new install

downloaded Stretch-lite image
etc.

Essentially what I did except:
1) I used etcher to write stretch to the micro SD card
2) I edited /boot/config.txt to add "enable_uart=1" and to enable I2C and SPI
3) I used method 1 instead of method 2 to install pigpio

I think it was item 2 which did me in. I have done it all again from writing stretch, except for mucking with config.txt, and mmbasic comes up fine.

Thanks for the detailed steps.

Amazing isn't it what people can do to confound your good work.
Edited by lizby 2018-11-28
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 2 of 2    
Print this page


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025