On 30/09/2020 20:12, RobH wrote:
> On 30/09/2020 18:35, RobH wrote:
>> On 30/09/2020 16:14, Lew Pitcher wrote:
>>> On Wed, 30 Sep 2020 14:02:23 +0100, RobH wrote:
>>>
>>>> I had to do a reinstall of my linux system due to a faulty ssd, and
>>>> have
>>>> a problem with a install.sh script.The said script is included in with
>>>> lcd files. which I downloaded from github.
>>>>
>>>> It is a simple script which runs a realtime clock on a pi zero with an
>>>> lcd screen.
>>>>
>>>> When I run ./install.sh, it fails at ./install.sh: line 34: syntax
>>>> error: unexpected end of file.
>>>>
>>>> I don't know what the syntax should be here;
>>> [snip]
>>>
>>> As others have suggested, the contents and origin of your install.sh
>>> script are in question. The best choice is to follow up on that, and
>>> obtain a valid install.sh script.
>>>
>>> Failing that, you might try more diagnosis on the current install.sh
>>> script. You might try some simple shell debugging techniques:
>>>
>>> 1) Use the shell to interpret, but not execute, the script by turning on
>>> the -n shell option. This will syntax-check the script without
>>> allowing
>>> it to perform any operations.
>>> For example:
>>> sh -n ./install.sh
>>>
>>> 2) Use the shell to execute the script while displaying the unexpanded
>>> shell commands to stdout, by turning on the -v option. This permits
>>> you to see exactly the script lines as they are read.
>>> For example:
>>> sh -v ./install.sh
>>>
>>> 3) Use the shell to execute the script while displaying the expanded
>>> shell commands to stdout, by turning on the -x option. This permits
>>> you to see the exact content of the executed lines.
>>> For example:
>>> sh -x ./install.sh
>>>
>>> Note: the -n, -v and -x option may not be available in all shell
>>> interpreters. If install.sh is a POSIX shell script, you may execute it
>>> with bash, which does support these options.
>>>
>>> HTH
>>>
>>
>> Running the above commands :
>>
>> rob@rob-Z97:~/Pi_lcd/lcd-master$ sh -n ./install.sh
>> ./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
>> (expecting "then")
>>
>> rob@rob-Z97:~/Pi_lcd/lcd-master$ sh -n ./install.sh
>> ./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
>> (expecting "then")
>>
>> rob@rob-Z97:~/Pi_lcd/lcd-master$ sh -x ./install.sh
>> ./install.sh: 34: ./install.sh: Syntax error: end of file unexpected
>> (expecting "then")
>>
>> So as there are only 33 lines in the script, would the line 34 be
>> hidden or something with the word "then"
>>
>> Update:
>> I copied and pasted the 33 lines into a new file and named it
>> instal.sh, then ran it.
>> Result:no errors apart from this one during the install process:
>>
>> ImportError: No module named RPi.GPIO
>> ./instal.sh: line 15: [: =: unary operator expected
>
> I have installed RPi.GPIO by:
> pip install RPi.GPIO and ran the install script again, but get this:
>
> Traceback (most recent call last):
> File "", line 1, in
> File
> "/home/rob/.local/lib/python2.7/site-packages/RPi/GPIO/__init__.py",
> line 23, in
> from RPi._GPIO import *
> RuntimeError: This module can only be run on a Raspberry Pi!
> ./instal.sh: line 15: [: =: unary operator expected
> I2C Pins detected as 1
> I2C Library setup for this revision of Raspberry Pi, if you change
> revision a modification will be required to i2c_lib.py
> Now overwriting modules & blacklist. This will enable i2c Pins
> Should be now all finished. Please press any key to now reboot. After
> rebooting run
> 'sudo python demo_lcd.py' from this directory
>
>
> I am trying to get this to work or run on a Pi Zero with a 16x2 lcd
> screen, and although the python demo_lcd.py script runs but for some
> reason it isn't activating the lcd screen
I managed to get rid of the error at line 15:
if [ $revision = "1" ]
by changing it to this:
if [ $revision: = "1" ]
so no unary operator error now.
Again the demo clock.py file runs but not the pi zero.
Thanks
--- SoupGate-Win32 v1.05
* Origin: Agency HUB, Dunedin - New Zealand | FidoUsenet Gateway (3:770/3)
|