11 Commits

Author SHA1 Message Date
david4599
d33ef3e10a Added Version 1.2 (20) in changelog 2022-08-27 19:34:35 +02:00
david4599
cf7ec44431 Fixed version bump 2022-08-27 19:07:18 +02:00
david4599
5782df9f38 Changed version in comment 2022-08-20 18:01:48 +02:00
david4599
607680fe40 Put the ino file in a folder with the proper name otherwise the Arduino IDE will complain and automatically create the folder which will affect the git local repo 2022-08-20 17:58:40 +02:00
david4599
b59400eb22 Fixed MainActivity.java 2022-08-19 19:53:51 +02:00
david4599
05efc0e52b Updated readme 2022-08-19 17:50:08 +02:00
david4599
22f00ef100 Added checksum verification of the barcode 2022-08-19 17:40:03 +02:00
david4599
d026ecf2c7 Fixed bad resolution in ST HD T Red type string 2022-08-19 17:10:35 +02:00
david4599
517a3ef667 Added 1371 ESL type and removed experimental string from ST HD L Red type 2022-08-19 17:06:23 +02:00
david4599
4fa5487e9c Merge pull request #2 from themillerdave/adding_newer_model_st_1370
Update to MainActivity.java adding new hardware type id 1370
2022-08-19 16:56:40 +02:00
Dave Miller
d9f2e28c8f Update MainActivity.java
New hardware type ID 1370, 2021 model - SmartTag HD L 296x128 in a black housing
2022-08-18 07:19:42 -04:00
5 changed files with 67 additions and 37 deletions

View File

@@ -1,5 +1,7 @@
# Pricehax BT
Working prototype of the ESL hack project of furrtek (https://github.com/furrtek/PrecIR) using Pricehax BT app, Arduino Nano board and HC-06 (or HC-05) module for bluetooth communication.
Prototype of the ESL hack project done by Furrtek (https://github.com/furrtek/PrecIR) using the Pricehax BT Android app, Arduino Nano board and HC-06 (or HC-05) module for Bluetooth communication.
**Disclaimer:** Only for educational purposes and fun. Both Furrtek and I decline all responsability for any kind of issues related to an illegal use of this repo. Be smart, the prices in the store's database will not change, you have been warned.
Videos about this project are archived in this [playlist](https://www.youtube.com/playlist?list=PLhEz48id1qqD27sRc73mDFfBpu_RcLxfZ) (most in French).
@@ -7,11 +9,21 @@ Videos about this project are archived in this [playlist](https://www.youtube.co
## Build
- Create the dongle on breadboard following the schematic (or order the pcb and solder the components)
- Using AT commands, change the name of the HC-05/HC-06 module to "PRICEHAX TX V3" and its baud rate to 57600bps (115200bps and more will not work because of the SoftwareSerial library usage that produces errors at those rates)
- Using the AT commands, change the name of the HC-05/HC-06 module to "PRICEHAX TX V3" and its baudrate to 57600bps (115200bps and more will not work because of the SoftwareSerial library usage that produces errors at those rates)
- Program the arduino nano with the included sketch
- Download and install the [Android app](https://github.com/david4599/PricehaxBT/releases/latest), pair the dongle and enjoy ;-)
## Android app changelog
### Version 1.2 (20)
**Features**
- Added 1370 and 1371 ESL types (ST HD L Red and ST HD150 Red black housing versions)
- Added checksum verification of the ESL barcode
**Fixes**
- Fixed SmartTag HD T definition in information label
### Version 1.2 (19)
**Features**
@@ -20,12 +32,12 @@ Videos about this project are archived in this [playlist](https://www.youtube.co
### Version 1.1 (18)
**Features**
- Red (and yellow?) ESLs are supported: https://youtu.be/0PFMIiDluDw
- Red (yellow not tested) ESLs are supported: https://youtu.be/0PFMIiDluDw
- Improved Bluetooth transmission reliability: comparison of received checksum and calculated checksum by the dongle
- Added the possibility to stop current image send
- Added the possibility to stop sending the current image
**Fixes**
- Fixed ST HD150 and ST HD200 definition
- Fixed ST HD150 and ST HD200 definitions
### Version 1.1 (17)
@@ -34,25 +46,22 @@ Videos about this project are archived in this [playlist](https://www.youtube.co
- Display debug infos for 24h
- Hide debug infos feature added
- Ability to blink the green LED on ST ESLs (not working yet on some): https://youtu.be/b0Rn40alxQg
- Start autofocus by touching the preview screen on "PLID Scan" tab
- Start autofocus by touching the preview screen on "PLID Scan" tab (not working sometimes?)
- ESL types added (mainly graphic ESLs, not tested on the most of them but it should work)
- Automatically choose sending compressed or raw data to graphic ESLs
- Ability to force not compressed data sending to graphic ESLs
- The number of repeats of frames for graphic ESLs can be chosen (speed transmission vs reliability)
- The dongle can be manually connected or disconnected in "Config" page
- Ability to force sending uncompressed data to graphic ESLs
- The number of frames repeats for graphic ESLs can be chosen (speed transmission vs reliability)
- The dongle can be manually connected or disconnected in "Config" tab
**Fixes**
- Fixed some bugs and app crashes
## Notes
- Android app sources are included
- I didn't write the app, I only decompiled sources of the apk, imported them on Android Studio and rebuilt the app
- The app supports only Bluetooth communication
- Furrtek had already code Bluetooth feature in the original app, I just made some changes for that feature works with my dongle
- I am not a programming or electronic expert, so maybe I made some mistakes on coding or making the schematic...
- I didn't write the app, I only decompiled the sources from the apk (that's why the code is a bit of a mess). Then, I imported them on Android Studio and fixed the decompilation errors preventing the re-compilation
- The app supports only Bluetooth communication, the original communication using audio has been disabled (not the goal of this repo)
- Furrtek did code the Bluetooth feature in the original app, I just made some changes so the feature works with my dongle
- I am not a programming or electronic expert, so the code and the schematic might be better...
#
Both furrtek and me decline all responsability for any kind of issues related by an illegal use of this project.
Copyright (c) furrtek 2014 - david4599 2019
Copyright (c) Furrtek 2014 & david4599 2019 - 2022

View File

@@ -6,7 +6,7 @@ android {
applicationId "org.furrtek.pricehaxbt"
minSdkVersion 15
targetSdkVersion 28
versionCode 19
versionCode 20
versionName "1.2"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}

View File

@@ -54,6 +54,7 @@ import android.widget.ToggleButton;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
@@ -152,19 +153,39 @@ public class MainActivity extends Activity {
Image barcode = new Image(size.width, size.height, "Y800");
barcode.setData(data);
if (MainActivity.this.scanner.scanImage(barcode) != 0) {
MainActivity.this.previewing = false;
MainActivity.this.mCamera.setPreviewCallback(null);
MainActivity.this.mCamera.stopPreview();
Iterator it = MainActivity.this.scanner.getResults().iterator();
while (it.hasNext()) {
String PLBarcode = ((Symbol) it.next()).getData();
setESLBarcode(PLBarcode);
if (setESLBarcode(PLBarcode)) {
MainActivity.this.previewing = false;
MainActivity.this.mCamera.setPreviewCallback(null);
MainActivity.this.mCamera.stopPreview();
}
else {
Toast.makeText(MainActivity.this, "The scanned barcode is invalid!", Toast.LENGTH_SHORT).show();
}
}
}
}
};
private void setESLBarcode(String PLBarcode) {
private boolean isBarcodeChecksumValid(String barcode) {
byte[] barcodeBytes = barcode.getBytes(Charset.forName("UTF-8"));
int checksum = 0;
for (int i = 0; i < barcodeBytes.length - 1; i++) {
checksum += (int) barcodeBytes[i];
}
checksum %= 10;
return checksum == barcodeBytes[barcodeBytes.length - 1] - '0';
}
private boolean setESLBarcode(String PLBarcode) {
if (!isBarcodeChecksumValid(PLBarcode)) return false;
MainActivity.this.plID = (long) ((Integer.parseInt(PLBarcode.substring(2, 7)) << 16) + Integer.parseInt(PLBarcode.substring(7, 12)));
String PLSerial = Long.toHexString(MainActivity.this.plID);
MainActivity.this.PLType = Integer.valueOf(Integer.parseInt(PLBarcode.substring(12, 16)));
@@ -288,8 +309,10 @@ public class MainActivity extends Activity {
MainActivity.this.hi = 128;
MainActivity.this.ESLType = 2;
break;
case 1370: // 2021 revision of the SmartTag HD L Red 296x128 - black housing
case 1328:
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD L Red 296x128) EXPERIMENTAL");
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD L Red 296x128)");
MainActivity.this.wi = 296;
MainActivity.this.hi = 128;
MainActivity.this.ESLType = 2;
@@ -305,14 +328,14 @@ public class MainActivity extends Activity {
case 1348:
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD T Red 296x128) EXPERIMENTAL");
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD T Red 264x176) EXPERIMENTAL");
MainActivity.this.wi = 264;
MainActivity.this.hi = 176;
MainActivity.this.ESLType = 2;
MainActivity.this.ESLTypeColor = true;
break;
case 1349:
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD T Yellow 296x128) EXPERIMENTAL");
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD T Yellow 264x176) EXPERIMENTAL");
MainActivity.this.wi = 264;
MainActivity.this.hi = 176;
MainActivity.this.ESLType = 2;
@@ -341,6 +364,7 @@ public class MainActivity extends Activity {
MainActivity.this.hi = 480;
MainActivity.this.ESLType = 2;
break;
case 1371: // 2021 revision of the SmartTag HD150 Red 648x480 - black housing
case 1353:
case 1354:
MainActivity.this.scaneitype.setText("Type: " + MainActivity.this.PLType + " (SmartTag HD150 Red 648x480)");
@@ -378,6 +402,7 @@ public class MainActivity extends Activity {
break;
}
MainActivity.this.barcodeScanned = true;
return true;
}
private boolean repeatMode = false;
@@ -1396,16 +1421,12 @@ public class MainActivity extends Activity {
String barcode = barcodeedittext.getText().toString().toUpperCase();
if (barcode.length() == 17) {
if (Character.isLetter(barcode.charAt(0)) && TextUtils.isDigitsOnly(barcode.substring(1, 17))) {
setESLBarcode(barcode);
if (!setESLBarcode(barcode)) {
Toast.makeText(MainActivity.this, "The barcode is invalid!", Toast.LENGTH_SHORT).show();
}
else {
Toast.makeText(MainActivity.this, "The barcode entered is invalid!", Toast.LENGTH_SHORT).show();
}
}
else {
Toast.makeText(MainActivity.this, "The barcode entered is not the right length!", Toast.LENGTH_SHORT).show();
Toast.makeText(MainActivity.this, "The barcode is not 17 characters long!", Toast.LENGTH_SHORT).show();
}
}
});

View File

@@ -82,7 +82,7 @@
android:layout_centerHorizontal="true"
android:layout_marginTop="48.0dip"
android:gravity="center_horizontal"
android:text="Version 1.2 BT (19)"
android:text="Version 1.2 BT (20)"
android:textColor="@color/textcolor"
android:textSize="15.0sp" />

View File

@@ -1,7 +1,7 @@
/*
* Pricehax BT IR dongle (for Pricehax Version 1.1 BT (18.0))
* Pricehax BT IR dongle (for Pricehax Version 1.2 BT (20))
* furrtek 2014
* david4599 2019
* david4599 2019 - 2022
*/
#define F_CPU 16000000L
@@ -158,4 +158,4 @@ void loop() {
}
_delay_ms(1);
}
}