Printing to Bluetooth Printer

Hello,
I'm having trouble with a project of mine. In this project I was able to wireless print to a Bluetooth printer via an Arduino and and HM-10 clone. I use a SoftwareSerial and Adafruit_Thermal. Durning Startup I sent AT commands to the HM-10 clone to set it up and connect to the printer. All worked great.

I went back to the ebay store and ordered the HM-10 clone again but now I can't get the new clone to even see the printer. Next I went ahead and got the real HM-10 Bluetooth module, it can see and connect to the printer but will not print.

I'm so frustrated I don't know what I'm missing. I tried several clones and they're all have different versions different AT commands... Is there something better I can use to connect to the printer and send the print messages to it?

I have also tried a serial thermal printer connected it directly to the SoftwareSerial port and it prints. Then I used to HM-10 clones and paired them and sent the serial print via the blue tooth and that worked. But I'm still not sure how or why the one clone works directly to the bluetooth printer and the others don't. I don't want to have to make my own bluetooth printer (using two HM-10s Paired and the serial thermal printer ) if I don't have to.

Thanks and any help or point in the right direction would be appreciated.

Here is the HM-10 Clone

Here is the Bluetooth Printer

Here is the real HM-10

Here is there serial Thermal Printer

I'm so frustrated I don't know what I'm missing.

Maybe missing...posting your code and how you configure everything?

OK here is the setup code that works with the HM-10 clone that I can't seem to get anymore of. I have one left in another project. Since this code works not sure what you'll find but Thanks. This whole bluetooth thing is a black box to me hope I can get away from the clones and find a reliable product that will work in my application.
Thanks

/***************************************************/


#include <Adafruit_GFX.h>    // Core graphics library
#include <Adafruit_ST7735.h> // Hardware-specific library
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include <Adafruit_Thermal.h>
#include <Adafruit_ADS1015.h>
//Adafruit_ADS1015 ads;     // Use this for the 12-bit version 
Adafruit_ADS1115 ads;  /* Use this for the 16-bit version */
#include<EEPROM.h>
#include <SoftwareSerial.h>
#define TX_PIN 6 // Arduino transmit  YELLOW WIRE  labeled RX on BT
#define RX_PIN 5 // Arduino receive   GREEN WIRE   labeled TX on BT

SoftwareSerial mySerial(RX_PIN, TX_PIN); // Declare SoftwareSerial obj first
Adafruit_Thermal printer(&mySerial);     // Pass addr to printer constructor

// For the breakout, you can use any 2 or 3 pins
// These pins will also work for the 1.8" TFT shield
#define TFT_CS     10
#define TFT_RST    9  // you can also connect this to the Arduino reset
// in which case, set this #define pin to 0!
#define TFT_DC     8

// Option 1 (recommended): must use the hardware SPI pins
// (for UNO thats sclk = 13 and sid = 11) and pin 10 must be
// an output. This is much faster - also required if you want
// to use the microSD card (see the image drawing example)
Adafruit_ST7735 tft = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);



// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 

// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 2);



//Project Defines
#define NUM_STEPS 200        // Steps for the motor to take in stepMotor (200 = 1 Rotation)
#define TOP_X_AVERAGES 30    // number of readings to use to calculate the average top 10= 3probes X10 =30 reading
#define NUM_PROBES 3        // number of probes connected

// global Variables
boolean ZeroButtonPushed=LOW;
float zeroes[NUM_PROBES];                    //make an array for holding the zero values of the sensors
float probes[NUM_PROBES];                    //make an array for holding measurement readin

float PositiveTopXArray[TOP_X_AVERAGES];                // make an array for holding TOP_X_AVERAGES max postitives
float negativeTopXArray[TOP_X_AVERAGES];                // make an array for holding TOP_X_AVERAGES Min negtitives
float positiveStrength, negativeStrength;    //used for averages
float positivePeakStrength, negativePeakStrength;              //used for finding peaks
float positiveTopXTotal, negativeTopXTotal;              //used for finding TOP_X_AVERAGE
float AverageForTotalNegativeField, AverageForTotalPositiveField; //Used for finding the average of the entire positive and negative fields
int16_t adc0, adc1, adc2, adc3;
char* BLUETOOTH_CONNECT_STRING = "f0217705023"; //Bluetooth connection string from the printer
float rotorTrimPos = 0;  // Value used to adjust the sensor reading so RMS Pro's read the same
float rotorTrimNeg = 0;  // Value used to adjust the sensor reading so RMS Pro's read the same


unsigned positiveCount, negativeCount;            //tallying the number for each reading used for count

unsigned globalStepCounter; //used for serial debug output. Displays current step next to measurements 


void setup(void) {
  
 // Use this initializer if you're using a 1.8" TFT
 delay(1);
tft.initR(INITR_BLACKTAB);   // initialize a ST7735S chip, black tab



//Splash Screen1
  tft.setRotation(1); //Sets Diplay Left to Right
  tft.fillScreen(ST7735_BLACK);
  tft.setTextColor(ST7735_RED);
  tft.setTextSize(3);
  tft.setCursor(20, 30);
  tft.println("RMS PRO");
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(1);
  tft.setCursor(60, 55);
  tft.print("Verson 1.4");
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(1);
  tft.setCursor(1, 65);
  tft.println("Please wait setting up BT");


// Printer setup
  // Setup for auto configuration of HM-10
Serial.begin(9600);

Serial.println("Please wait setting up BT...");

mySerial.begin(9600);

// test for auto setup HM-10
mySerial.write("AT+DEFAULT\r\n");
delay(500);
mySerial.write("AT+TYPE0\r\n");
delay(500);
mySerial.write("AT+NAME RMSPRO \r\n");
delay(500);
mySerial.write ("AT+ROLE1\r\n");
delay(500);
mySerial.write ("AT+IMME1\r\n");
delay(500);
mySerial.write ("AT+BAUD4\r\n");
delay(1000);
//(AT+CON # \r\n) bluethooth printer Address followed by \r\n
mySerial.write ("AT+CON0f021770826a\r\n");
delay(1500);

 printer.begin();        // Init printer (same regardless of serial type)
Serial.println(" Done:");


// Tell user the BT printer is working
  printer.wake();       // MUST wake() before printing again, even if reset

  printer.println("Printer Sucessfully Paired");
  printer.feed(3); // use for Bluetooth printer
 // end printer setup
delay(5000);
  AFMS.begin();  // create with the default frequency 1.6KHz

  myMotor->setSpeed(10);  // 10 rpm   

// Setup Adafruit ADC 12 bit

 // The ADC input range (or gain) can be changed via the following
  // functions, but be careful never to exceed VDD +0.3V max, or to
  // exceed the upper and lower limits if you adjust the input range!
  // Setting these values incorrectly may destroy your ADC!
  //                                                                ADS1015  ADS1115
  //                                                                -------  -------
  // ads.setGain(GAIN_TWOTHIRDS);  // 2/3x gain +/- 6.144V  1 bit = 3mV      0.1875mV (default)
  // ads.setGain(GAIN_ONE);        // 1x gain   +/- 4.096V  1 bit = 2mV      0.125mV
  // ads.setGain(GAIN_TWO);        // 2x gain   +/- 2.048V  1 bit = 1mV      0.0625mV
  // ads.setGain(GAIN_FOUR);       // 4x gain   +/- 1.024V  1 bit = 0.5mV    0.03125mV
  // ads.setGain(GAIN_EIGHT);      // 8x gain   +/- 0.512V  1 bit = 0.25mV   0.015625mV
  // ads.setGain(GAIN_SIXTEEN);    // 16x gain  +/- 0.256V  1 bit = 0.125mV  0.0078125mV
  
ads.begin(); 

  //Splash Screen2
  tft.setRotation(1); //Sets Diplay Left to Right
  tft.fillScreen(ST7735_BLACK);
  tft.setTextColor(ST7735_RED);
  tft.setTextSize(3);
  tft.setCursor(20, 30);
  tft.println("RMS PRO");
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(1);
  tft.setCursor(60, 55);
  tft.print("Verson 1.4");
  tft.setTextColor(ST7735_WHITE);
  tft.setTextSize(1);
  tft.setCursor(25, 65);
  tft.println("Press DOWN to begin");
  

  

#define Neutral 0
#define Press 1
#define Up 2
#define Down 3
#define Right 4
#define Left 5



}// END OF SETUP

You have way too many things in there to do a test. Just do a bare minimum setup. You also don’t test what the serial AT commands return so you don’t know what’s going on...

When you do AT+BAUD4 you put your HM-10 interface at 115200 bauds. Not only it won’t be reliable with softwareSerial but your mySerial object is still at 9600 bauds ... I doubt it ever worked

Many HM-10 don’t support 5V - how is this wired?
Many HM-10 firmware don’t like \r\n (will probably just be ignored)

I found a Bluetooth interface that worked well.

The Sparkfun Bluetooth Modem work perfectly.

Here is a nice tutorial on hookup and Command mode...

I own a 58MM Portable MINI Thermal Printer and a Spark Fun Blue SMiRF Silver Bluetooth shield. I programmed a simple counter and I would like to print the results via my Bluetooth printer. Because I am a newcomer in programming I dont know how to connect the printer with the Arduino and send data to the printer. Could you or anybody else send me a simple Skript, that send a "Hello World" to the printer and a instruction how to install the printer in order to receive data.
Thanks in advance

Is that the same printer ? See adafruit info for their printer and instruction language in their library.

If your printer expects a different command language, then you’ll have to write that.
If your printer does not offer a Serial communication then you’ll need to adjust to what’s expected.

==> find the exact datasheet and specs of your printer (and open your own post if it’s different)

Thanks for replaiing
Sorry I just opened an account for this forum. So I dont know how to open a new post.
My Printer is

This Manual gives only a few information how to operate the printer.

geissberg:
Sorry I just opened an account for this forum. So I dont know how to open a new post.

take the time to read the posts pinned at the top of the forum to understand how to post here