Lookout local

Back in 2014, we were using excel spreadsheets to record details of property handed in and reports of lost property. We had 2 laptops, and anyone wanting to check on handed in property had to go to the one laptop and to file a lost property report had to use the other. It was causing a bottleneck, so we designed an inhouse intranet using a RaspBerry Pi for 2014.

2015 was much better, but the inability to turn the Pi off without running the risk of it crashing meant we had to develop the system further.

in 2016 we trialled new software and used an old standalone server running a LAMP webserver/database system. We set up a wifi router so any device could login and access the intranet.  The use of the local intranet meant that we could run an online database without actually having an active internet connection. We did however attach a 3g mobile modem to the system so we could send and receive emails through the system and also send text messages using the online clickatell service. This provided much needed instant contact with enquirers at the festival.

At this point, volunteers working on the service who helped at other festivals expressed an interest in developing the system for generic use

2017 was much better, we had rewritten the software in the light of experience of past use, and included a receipt printer (like the ones used at cash tills in shops) The use of the printer meant we could do away with the old handwritten backups we used to keep of each transaction.- we just filed the printed receipt instead, which gave us the necessary paper backup of all transactions.

We also hooked up a mobile phone dongle with a VodaFone PAYG sim. This set us free from the clickatell SMS interface and enabled us to not only send SMS from the system, but also to receive then and log them on the system.  We chose VodaFone as the it had the best PAYG package for unlimited texts (£10 for the month).

We had visits from other festival organisers interested in using the system, and decided to invest in more reliable and robust equipment that could be loaned out to other festivals’ lost property teams.

We started to develop the whole system as a unified package, purchasing equipment and setting it up as a bespoke system for dealing with lost property and festivals and events. We called it “Lookout” and this blog is a a record of what we did and how we did it.  If you want to construct your own, please follow along, hopefully all the info you need to set up your own system is here. Or of course you could always borrow ours!!

 

 

Posted by leeds11 in Uncategorised, 0 comments

First step: The Server

At the core of the system is computer acting as webserver.

Almost any computer can be put to use as a webserver, as long as its base operating system is Linux, NOT Windows!

We used Ubuntu 16 LTS as the operating system, and shall assume you are doing the same. We opted for the desktop version, as it meant that the webserver computer could also be put into use as one of the workstations used for reporting and recording lost and found property.

You can of course use any computer, and an old desktop computer would do the job quite cheaply, but you’d have to set up the whole system; screen, workstation, keyboard, power supply, etc. onsite. We wanted to make the whole system as simple and uncomplicated and compact as possible so we opted to use an Ubuntu laptop.

We tried installing Ubuntu on one or two second hand laptops without much success. – The main issue is finding drivers for the laptop screen, When we did get it going, the laptop was under resourced for its potential task, so  we purchased a new Ubuntu laptop from Entroware.

There are other Linux laptop suppliers. Beware purchasing a new laptop with windows installed. In the first place you will have to remove the windows operating system which you have paid extra for, and in the second place, you may have the same problems we had getting Ubuntu to install on it.

Once you have your computer set up and running as an Ubuntu 16 Desktop system, you are ready to go onto the next step: adding SMS text capabilities.

Posted by leeds11 in Uncategorised, 0 comments

Step two: adding SMS text capabilities – The VodaFone account

SMS will allow the system to contact enquirers when possible matches have been made to lost property enquirers and ask them to come in to make a claim. They can also TXT the system if the item turns up so the system can delete the enquiry from the database.

You’ll need an active  SIM card for the system to send and receive SMS.

We went with a VodaFone PAYG SIM only with the £10 big value bundle that gives:

1GB 4G Data
200 Minutes
Unlimited Texts (This is the key feature for our purposes)
+150 Reward points
The best way to set this up and activate it is to put it in a mobile phone and follow the registration process. (if you have to press the SIM out to use it as a nano sim in the phone, keep the larger bit, you will need it to put the SIM into the USB modem.)
While you have the phone active, activate the answerphone system and record a nice message to say its not possible to make voice calls to this number and give an alternative number they can call.  – Then set options for the answerphone to kick in asap.
Now go to the VodaFone website and set yourself up an account for this number so you can top up online and manage your sim account.
When registering, make sure you include a second mobile number that confirmation codes can be sent to when you login. – Otherwise you won’t be able to access the account to top up.
Once logged in, as well as setting up payment details there are a few adjustments you may want to make.
Under Account Summary > Services and Extras > Bars and data alerts
you can set up various blocks to prevent accidental abuse of the service by e.g.:
  • restricting content downloaded
  • stopping calls and texts when abroad
  • set data limits, etc.

Take the SIM out of your phone and press it back into the larger holder ready to put in the USB modem.

Now see:  Step three: adding SMS text capabilities – The USB modem

Posted by leeds11 in Uncategorised, 0 comments

Step three: adding SMS text capabilities – The USB modem

You’ll need a USB modem to put it in (some more expensive laptops have sim card slots, so you won’t need a modem – on the other hand they might not work with our system …)

Not all modems work with Linux, we chose one that there seemed to be a lot of support for. Huawei E303 3G 7.2Mbps USB Modem (purchased from Amazon)

We found that the modem did not always get recognised by linux as a modem, sometimes only  the storage capability of the device was recognised which meant the modem became inoperable. Basically you need “enable mobile broadband” to show in the dropdown list illustrated below.

We need to make modem recognition persistent. Here’s what worked for us (for an older usb modem):

 

Huawei Linux Driver Download And Installation

HUAWEI LINUX DRIVER INSTALLATION
Download and install Huawei Linux Driver from the site above  Or follow this link

We found the modem was always recognised after doing this.

Failing this, you may be able to configure usb-modeswitch to do the same (for a newer modem:

 

create a file called 12d1:1f01 in /etc/usb_modeswitch.d

content to be:

# Huawei E353 (3.se)

TargetVendor= 0x12d1
TargetProduct= 0x1001

MessageContent=”55534243123456780000000000000011063000000100010000000000000000″
NoDriverLoading=0

 

 

 

 

 

Posted by leeds11 in Uncategorised, 0 comments

Step four: install virtualmin

create /root/resolv.conf

content:
nameserver 127.0.0.1

in /etc/rc.local put:
bin/cp /root/resolv.conf /run/resolvconf/resolv.conf

Your Postfix configuration is missing the system’s mail hostname leeds11-Triton from the mydestination line, which will cause mail to bounce. The current value is triton.leeds11.com, triton.leeds11.com, localhost.leeds11.com, localhost.

in etc/postfix/main.cf line 35ish

No Ethernet interface could be automatically found on your system. Use the module configuration page to set the interface manually.
Network interface for virtual addresses from > wlp2s0 (confirm with ifconfig)
Default virtual server IPv4 address > 127.0.0.1
Default IP address for DNS records > Same as virtual server IP

nano /etc/dhcp/dhclient.conf remove domain-name-servers, from

request subnet-mask, broadcast-address, time-offset, routers,
domain-name, domain-name-servers, domain-search, host-name,
dhcp6.name-servers, dhcp6.domain-search, dhcp6.fqdn, dhcp6.sntp-servers,
netbios-name-servers, netbios-scope, interface-mtu,
rfc3442-classless-static-routes, ntp-servers;

virtualmin configure BIND > Forwarding and Transfers > Servers to forward queries to> 8.8.8.8

check internet connection OK on laptop.

Posted by leeds11 in Uncategorised, 0 comments

Step four: adding SMS text capabilities – gammu

From now on, most of the work will be done via terminal. Click on the search button, type “terminal” and open a terminal window.

type su root and enter root password

then:

lsusb – make sure modem is identified.

Bus 001 Device 006: ID 12d1:1506 Huawei Technologies Co., Ltd. Modem/Networkcard

In our case: (Modem/Networkcard is the important thing) – Also note the vendor and product IDs > vendor= 12d1 and product = 1506

apt-get install wvdial

wvdialconf

Found a modem on /dev/ttyUSB0.
Modem configuration written to /etc/wvdial.conf.
ttyUSB0<Info>: Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2”
ttyUSB2<Info>: Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2”
ttyUSB_utps_pcui<Info>: Speed 9600; init “ATQ0 V1 E1 S0=0 &C1 &D2”

– note the  port (/dev/ttyUSB0) and speed (9600)

(optional for if the modem doesn’t get recognised):

apt-get install usb-modeswitch

(change vendor and product numbers below to match your modem)

usb_modeswitch -W -v 19d2 -p 1506 -M “5553424312345678000000000000061b000000020000000000000000000000”

Gammu will be the controller for sending/receiving text messages. gammu-smsd is the service which constantly monitors gammu, moving incoming texts into a folder and sending outgoing texts to gammu that have been placed in a (different) folder.

we’ll look at setting persistent port later
Persistent paths for dynamic device file

apt-get install gammu
apt-get install gammu-smsd (dont worry about any error)
mkdir -p /var/log/gammu /var/spool/gammu/{inbox,outbox,sent,error}
chown www-data:www-data -R /var/spool/gammu/*
wget -c https://raw.githubusercontent.com/antonraharja/playSMS/master/contrib/gammu/linux/gammu-smsdrc
(or use this:

[gammu]
port = /dev/ttyUSB0 ** CHECK THIS
connection = at9600 ** CHECK THIS
logfile = /var/log/gammu/gammu.log
logformat = textall

[smsd]
Service = files
InboxPath = /var/spool/gammu/inbox/
OutboxPath = /var/spool/gammu/outbox/
SentSMSPath = /var/spool/gammu/sent/
ErrorSMSPath = /var/spool/gammu/error/
InboxFormat = unicode
OutboxFormat = unicode
TransmitFormat = auto
debugLevel = 1
LogFile = /var/log/gammu/smsd.log
DeliveryReport = sms
DeliveryReportDelay = 7200
CheckSecurity = 0

nano /etc/gammu-smsdrc

check port and connection speed as above

 

ln -s /etc/gammu-smsdrc /etc/gammurc

gammu -f /var/log/gammulog identify

IF THIS FAILS TRY
/etc/init.d/gammu-smsd stop

and/or apt-get install gammu-smsd
THEN TRY AGAIN

nano /etc/init.d/gammu-smsd
Edit USER=gammu to USER=root

gammu sendsms TEXT Receiver-Phone-No -text “Hello World!”

/etc/init.d/gammu-smsd start

nano /etc/rc.local

Add /etc/init.d/gammu-smsd start before exit 0

Posted by leeds11 in Uncategorised, 0 comments

new ubuntu laptop

Download

To install Notepadqq from Ubuntu, simply run the following commands in a terminal:

sudo add-apt-repository ppa:notepadqq-team/notepadqq
sudo apt-get update
sudo apt-get install notepadqq

install filezilla

apt-get install openssh-server

nano /etc/ssh/sshd_config
change
PermitRootLogin prohibit-password
to
PermitRootLogin yes

service ssh restart

set default text editor in filezilla /usr/bin/notepadqq

create file 12d1:1f01 in /etc/usb_modeswitch.d
content:
#TargetVendor=0x12d1
#TargetProductList=”14db,14dc”
#HuaweiNewMode=1
# replace everything below with above if it doesnt work….
# Huawei E353 (3.se)
TargetVendor= 0x12d1
TargetProduct= 0x1001
MessageContent=”55534243123456780000000000000011063000000100010000000000000000″
NoDriverLoading=0

check that lsusb shows the modem

apt-get install gammu
mkdir -p /var/log/gammu /var/spool/gammu/{inbox,outbox,sent,error}
chown www-data:www-data -R /var/spool/gammu/*
gammu -f /var/log/gammulog identify

create gammu-smsdrc
nano /etc/gammu-smsdrc
content:
[gammu]
port = /dev/ttyUSB0
connection = at9600
logfile = /var/log/gammu/gammu.log
logformat = textall

[smsd]
Service = files
InboxPath = /var/spool/gammu/inbox/
OutboxPath = /var/spool/gammu/outbox/
SentSMSPath = /var/spool/gammu/sent/
ErrorSMSPath = /var/spool/gammu/error/
InboxFormat = unicode
OutboxFormat = unicode
TransmitFormat = auto
debugLevel = 1
LogFile = /var/log/gammu/smsd.log
DeliveryReport = sms
DeliveryReportDelay = 7200
CheckSecurity = 0

apt-get install gammu-smsd

/etc/init.d/gammu-smsd start
nano /etc/rc.local
Add /etc/init.d/gammu-smsd start before exit 0

may need to delete files in /var/crash/* to prevent error message repeating on bootup

hostname triton.leeds11.comxxx

wget http://software.virtualmin.com/gpl/scripts/install.sh
chmod +x install.sh
./install.sh

Posted by leeds11 in Uncategorised, 0 comments

Post virtualmin stuff

create phpmyadmin.local website and install phpmyadmin script at top level

sudo mysql –user=root mysql
CREATE USER ‘leeds11’@’localhost’ IDENTIFIED BY ‘PASSWORD’;
GRANT ALL PRIVILEGES ON *.* TO ‘leeds11’@’localhost’ WITH GRANT OPTION;
FLUSH PRIVILEGES;

Posted by leeds11 in Uncategorised, 0 comments