Skip to main content

Modelo Linux


img

Starting Graphical Mode

When the M-ID40 module is turned on, the operating system will already be initialized in terminal mode. By default, the graphical mode is disabled to make better use of the hardware and improve performance.

To use the Linux graphical mode, type the following command in the terminal:

startx

A loading message will be displayed and the system IDE will be loaded.

img


Connection to wireless network

Linux has a WiFi 2.4 GHz and 5.0 GHz and LAN adapter.

To connect to a network, go to the menu higher than the network option, by clicking a dropdown list will be displayed with WiFi networks, you can also activate or disable wifi by clicking ‘Turn off/on wifi’.

img

Network configuration in graphic mode

By right -clicking on the network icon, and selecting the Wireless & Wired Network Settings option, the network settings window is opened.

img

img

img

Important

In this window you can configure whether the reader's IP will be fixed or automatic for both wireless and cable network.

Putty network configuration

Connect to the reader by Putty using credentials:

  • User: viaonda
  • Password: viaondarfid

Edit the file /etc/dhcpcd.conf

So that the IP is automatic just comment (include "#" on beggining) The lines that define the fixed IP.

Should be as below:

interface eth0
noipv6
#static ip_address=192.168.0.10/24
#static routers=192.168.0.1
#static domain_name_servers=
#static domain_search=

Save the file and restart the reader for changes to be applied.

External access

The module makes available from a VNC server installed for external access and viewing the system interface internally. By default the access is made using the Username: viaonda and Password: viaondarfid.


Documents and Programs

Files to manage M-ID40 are gathered in the Document folder in the user directory within Linux.

Directory

To access a directory on Linux, type CD and the name of the directory you want to access.

cd Documents/

Listing Files

To list the existing files in a directory.

ls -ln

A detailed listing of the files will be displayed.

In Linux the demarcated files with green color are executable files.

Communication files with module

  • getreaderinfo: Returns the reader configuration parameters.
  • reset-database: Delete all records of the Tag Table and reset the value of auto_increment.
  • rfid: Starts reading and inventory of the reader for all antennas.
  • setantenna_on: Enables the antenna, passing its number as a parameter.
  • setpower: configures the reader's output power in dB.

Run code

To run a script, type ./name-script, example:

./rfid

img


GPIO

The M-ID40 reader has 2 settings for input and output GPIOs configuration, allowing you to use the controls by the module and control by Linux, this definition can be requested at the time of purchase.

Pins

Being defined communication with Linux, the pins are:

PinwiringPiGPIONameHeader
Saída 1227GPIO213
Saída 2017GPIO011
Saída 31210MOSI19
Saída 4139MISO21
Entrada 1322GPIO315

Pins Status

gpio readall

The readall command it presents the general status of all module pins and their respective references.

img

Define pin as output

gpio -g mode 10 out
  • g: Use of GPIO pin references.
  • 10: Pin number.
  • mode: Pin Configuration as input/output.
  • out: Configures as an output(out).

Define pin state

gpio -g write 10 1
  • g: GPIO pin reference.
  • write: write or read.
  • 10: Pin number
  • 1: Configures pin as high (1) or low (0)

img


Tag Readings

To start reading tags, run the rfid file in documents folder.

cd Documents/
./rfid

When running, information about the reader will be loaded to start reading, enter any key. To finalize the reading, type Ctrl + C that the execution will be closed.

img


Compile Program

To compile a program through the Linux terminal, use the GCC passing as a parameter the libraries you want to use.

Example: If you want to make changes to the tag reading script, use the following command on the terminal within the document folder to compile.

gcc main.c Uhf.o -o rfid -g3 -lcurl -lwiringPi `mariadb_config --cflags --libs`
  • gcc: Language Compiler for C and C++.
  • main.c: File name C to compile.
  • Uhf.o: External file used in reading.
  • rfid: Output file name.
  • -g3: Parameter used for debug.
  • -lcurl: URL transfer library easy to use on customer side.
  • -lwiringPi: Linux PI GPIO library for gpio access.
  • mariadb_config --cflags --libs: Mariadb Library used for communication with the database.

img


Tags Structure Table

FieldDescriptionTypeNullKeyDefault valueExtra
tag_idUnique field identifierint(11)NOPRINULLauto_increment
tag_epcTag read EPCvarchar(50)YESNULL
tag_read_rssiValue of RSSIint(11)YESNULL
tag_read_dateReading datedatetimeYESNULL
tag_read_antennaAntenna identificationint(11)YESNULL
tag_read_wsRead registration controlint(11)YESNULL

img


Dashboard

Dashboard containing the module configuration functions available. To access, navigate to the main directory of the equipment web server, accessing http://{ip_modulo}.


Added Later

img

  • Min RSSI : Considers only the readings with RSSI greater than the defined.

  • Max RSSI : Considers only the readings with RSSI lower than the defined.

Database

The database is an internal server, aiming to store the readings realized, more efficiently carrying the data recorded on your device, This way bringing more productivity to your applications.

To access it, it can be done in the following ways:

Through the settings as shown in the example of the above image

  • Host : IP or host of the server where your database is hosted.

  • Porta : Communication port.

  • Usuário : Database access user.

  • Senha : Password to access the database.

  • Nome do Banco : Database Name.

To access the bank on Linux, enter the following command at the terminal and press ENTER.

mysql -u viaonda -p

The default password for the user viaondadb: viaonda@2018

  • -u: Indicates the user which they want to use to connect to the database.
  • viaonda: Username.
  • -p: Indicates the user's password to connect with the database.

After accessing the database, you can use SQL commands to navigate, where the Tags table is registered, for example: use viaondadb;


Web Service

Documentation of the methods and functions on the web service is available in: API documentation.