-
Notifications
You must be signed in to change notification settings - Fork 77
/
Copy pathINSTALL
240 lines (139 loc) · 7.88 KB
/
INSTALL
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
-----------------------Installing iotPOS on the Raspberry Pi and Hardware setup--------------------------------------
-Only for or Raspbian OS users, we recommend to uninstall useless apps for a dedicated point of sale:
sudo apt-get update
sudo apt-get remove scratch wolfram-engine sonic-pi minecraft-pi
sudo apt-get clean
sudo apt-get autoremove
sudo reboot
---------------------------------------------------AUTO SOFTWARE-SETUP-------------------------------------------------------
-This method is the easy way to setup and install iotpos.
Just copy and paste the following lines into a terminal:
sudo apt-get update
git clone https://www.github.com/hiramvillarreal/iotpos
cd iotpos
sudo chmod +x install.sh
sudo ./install.sh
NOTE: For Raspberry Pi Zero/W users this could take almost an hour to compile so be patient.
If the sudo ./install.sh does not work try:
sudo sh install.sh
If you wish to setup and install manually please see below:
---------------------------------------------------MANUAL SOFTWARE-SETUP----------------------------------------------------
Just in case you already didn't, make sure everything is up to date:
sudo apt-get update
Now that everything is up to date, we can install the needed kde4 packages (kdelibs4, kdebase4, kdepimlibs4) and all of his
dependencies (qt4...), and everything else we need for the compile and install:
sudo apt-get install kdebase-runtime libqt4-dev build-essential g++ cmake gettext libqt4-sql-mysql kdelibs5-dev
For a spanish KDE app:
sudo apt-get install kde-l10n-es
Once you have KDE, and QT4 installed, we can install mysql:
sudo apt-get install mysql-client mysql-server
Now you can download the app from git:
cd ~
git clone https://github.com/hiramvillarreal/iotpos
Move into the newly created directory, create a 'build' directory inside and move into it:
cd iotpos
mkdir build
cd build
Inside build directory run CMake with your path to KDE4:
cmake .. -DCMAKE_INSTALL_PREFIX=`kde4-config --prefix`
FOR OTHER LINUX DISTROS TRY THIS:
cmake -DCMAKE_INSTALL_PREFIX=kde4-config --prefix -DQT_QMAKE_EXECUTABLE=which qmake-qt4 -DQT_INCLUDE_DIR=/usr/include/qt4 -DCMAKE_BUILD_TYPE=Release ..
Run make to compile iotpos. This took about an hour on the Pi A, A+, B and B+, took 15 minutes on the new Pi2:
make
After the compile is finished, you will need to install everything:
sudo make install
OPTIONAL:copy the iotposrc file to your local .kde/share/config directory:
cp iotpos/src/iotposrc /home/USER/.kde/share/config/ #Replace USER with your username: pi.
After installation, you need to create a database and user on mysql, to do this:
cd ~/iotpos/database_resources
cat iotpos_mysql.sql | mysql -u root -p
Note, if you are using 0.9.7, to migrate from 0.9.7 to 0.9.8.0 database version run this as:
cat fix_0.98.sql | mysql -u root -p
To restore a database with preloaded products and examples:
sudo mysql -u root -p iotposdb < iotposdb.sql
To start using the point of sale, in terminal type:
iotpos
* The default and only user and password is (without quotation marks):
username: "admin"
password: "linux"
To start using the administration module, in terminal type:
iotstock
For an easy first time use, all securyty settings are disabled.
Shorcut apps will be found inside the aplication menu in raspbian under Others item or at ~/iotpos/src and
~/iotpos/iotstock/src you can copy and paste them on the desktop.
By default, IotPOS and IotStock have security disabled, this to let you configure database settings in case
you have installed the database server at a different computer.
---------------------------------------------------HARDWARE-SETUP------------------------------------------------------
* SERIAL TTL THERMAL PRINTER INSTALL
The serial port on the Raspberry Pi’s GPIO header is normally configured for console cable use,
will output a Console from your Pi that, with a suitable Serial cable, you can use to control your Pi via the command-line.
But now we want to use this port for the thermal printer instead, so we’ll need to disable this default behavior.
sudo raspi-config
Advanced options
Serial / Enable/Disable shell and kernel messages on the serial connection
Would you like a login shell to be accessible over │
│ serial? NO
* These libraries are required by the thermal printer library and example programs:
sudo apt-get install python-serial python-imaging python-unidecode
* Test the printer with:
cd ~/py-thermal-printer-master
sudo python printer.py
CONECCTIONS FOR THE HARDWARE
-----SERIAL TTL THERMAL PRINTER----
NOTE: TTL printers are not supported on the Raspberry Pi 3 by default. You have to Add device tree to /boot/config.txt
to disable the Raspberry Pi 3 bluetooth.
sudo nano /boot/config.txt
Add at the end of the file:
dtoverlay=pi3-disable-bt
Exit the editor saving your changes.
Now disable the Serial Console edit the file using
sudo nano /boot/cmdline.txt
Remove the word phase "console=serial0,115200" or "console=ttyAMA0,115200" exit the editor saving your changes.
Reboot the pi
sudo reboot
WARNING!!!: Make sure a serial TTL printer is used, NEVER CONNECT A SERIAL RS232 TO PI'S GPIO!!! even using a TTL conection, never conect the side printer Tx pin to Rx GPIO on the pi, the Tx wire is only used for rare cases where the printer returns data to the computer. It’s left unconnected because the printer works at 5 Volts and the Raspberry Pi at 3.3 Volts… connecting directly to the Rx pin could permanently damage the Raspberry Pi! (The other direction is safe as-is.).
Serial Data Cable Rx TO Physical pin 8 It's also commonly known as "Serial TX" ttyAMA0.
Serial Data Cable Tx DO NOT CONNECT IT TO THE GPIO RX AS SOME ARE 5 V TTL WILL DAMAGE THE RASPBERRY PI!!!
Serial GND from serial printer to any gpio GND could use Physical pin 6,9, 14.
-----Push buttom and LED.
Push bottom N.O. to Physical pin 16 switch to GND.
LED+ Physical pin 12 LED- TO any GND available.
-----------------------Allow to send notifications and reports by e-mails from the Raspberry Pi. -----------------------
Install SSMTP and mail utilitites:
sudo apt-get install ssmtp
sudo apt-get install mailutils
Edit the SSMTP configuration file:
sudo nano /etc/ssmtp/ssmtp.conf
root=postmaster
mailhub=smtp.gmail.com:587
hostname=raspberrypi
AuthUser=YourGMailUserName@gmail.com
AuthPass=YourGMailPassword
UseSTARTTLS=YES
Be sure to specify the correct GMail user name and password here, otherwise you will get authentication errors.
If the host name of your Raspberry Pi is different from “raspberrypi”, specify your actual host name here instead.
Set the permissions of the SSMTP configuration file:
sudo chmod 774 /etc/ssmtp/ssmtp.conf
Edit the script:
nano ~/iotpos/scripts/corteMail.sh
replace -your_mail@gmail.com- with your gmail account.
----------------------------------------------------QT CREATOR INSTALL---------------------------------------------------------
Needed only for Developers.
If you want to cntribuite with the proyect you need to install Qt4 on the Raspberry Pi
sudo apt-get install qt4-dev-tools
Then:
sudo apt-get install qtcreator
Also installed:
sudo apt-get install gcc xterm subversion
this gives as a result Qt Creator 2.5 with Qt 4.8.1 32 bit
--------------------------------------------------Configure toolchain.---------------------------------------------------------
Open QT under Application menu>Programming>Qt Creator
Go to:
Tools/Options > build & run > tab tool chains > button add Choose GCC
Then set compiler path : /usr/bin/arm-linux-gnueabihf-gcc-4.6
Debugger : /usr/bin/gdb
Mkspec : default
Go to menu help > about plugins
Uncheck device support > remote linux
Restart Qt Creator
Go to tools > options TAB > build & run > Qt versions > add "/usr/bin/qmake-qt4"