Engineering and technology notes

esp8266 – AT+CIPSEND command does not return “>” in Arduino code but working manually – Stack Overflow

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

#define DEBUG true

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }
  mySerial.begin(9600);
  sendData("AT+RST\r\n", 2000, DEBUG); // rst
  sendData("AT+CWJAP=\"wifi namne\",\"password\"\r\n", 3000, DEBUG); //enter name and password
}

void loop() {
  int key;
  sendData("AT+CWMODE=1\r\n", 1000, DEBUG); //  access point
  sendData("AT+CIFSR\r\n", 1000, DEBUG); // get ip address
  sendData("AT+CIPMUX=1\r\n", 1000, DEBUG); // configure for multiple connections
  sendData("AT+CIPSTART=4,\"TCP\",\"api.thingspeak.com\",80\r\n", 1000, DEBUG); // turn on server on port 80
  key = 23;   //random number for testing
  String web = "GET http://api.thingspeak.com/update?api_key=KTQXXXXXXXXXXXXX&field1="";
  web += key;
  web += "HTTP / 1.0";
  web += "\r\n";
  web += "\r\n";
  String cipsend = "AT + CIPSEND = ";
  cipsend += 4;
  cipsend += ", ";
  cipsend += String(web.length());
  cipsend += "\r\n";
  sendData(cipsend, 1000, DEBUG);
  sendData(web, 10000, DEBUG);
  String closeCommand = "AT + CIPCLOSE = ";
  closeCommand += 4;// append connection id
  closeCommand += "\r\n";
  sendData(closeCommand, 3000, DEBUG);
}

String sendData(String command, const int timeout, boolean debug) {
  String response = "";
  mySerial.print(command); // send the read character to the esp8266
  long int time = millis();
  while ( (time + timeout) > millis()) {
    while (mySerial.available()) {
      // output to the serial window
      char c = mySerial.read(); // read the next character.
      response += c;
    }
  }
  if (debug) {
    Serial.print(response);
  }
  return response;
}

 

Source: esp8266 – AT+CIPSEND command does not return “>” in Arduino code but working manually – Stack Overflow

Nvidia settings don’t stick

Any changes you make in the NVIDIA X Server Settings utility to brightness, contrast and gamma will revert back to their original default values
after restarting your system, or even after logging out and back in. If you want the changes to remain, then you will have to manually edit the
“.nvidia-settings-rc” file. For the benefit of anyone else reading this topic, this is a hidden file located in “/home/your-user-name” and will only be available after installation of a Nvidia proprietary driver. Open the file and at the bottom add the line:
0/Gamma=0.800
The default value is 1.000 and any value below it will darken the screen. I have mine set to 0.900. This makes any text on the screen a little darker and easier for me to read.

To change the Gamma of only one color add the lines:
0/RedGamma=1.000 (whatever value you want)
0/GreenGamma=1.000
0/BlueGamma=1.000

Save the file. Unfortunately, if you ever reopen the NVIDIA X Server Settings utility, then these settings will be removed from this file and you will
have to manually add them back. This is not a problem for me since I will rarely need to use that utility but for others it may be a good idea to have a backup of that file. Some day if I have some extra time, I may work on this problem.
If this method does not work, then you will also have to add the following line to the xinitrc file located in “/etc/X11/xinit”. Right click on the file and select “Open as Root”. Open the file and add the line:
nvidia-settings –load-config-only

 

Source: Nvidia settings don’t stick – Linux Mint Forums

why I have a PDP DEACT ??? SIM300C | Forum for Electronics

>> AT+CGATT=1   - Attach to GPRS Service 
<< OK 

>> AT+CGDCONT=1,"IP","wap.cingular"   - Define PDP Context (cid, PDP type, APN) 
<< OK 

>> AT+CDNSCFG="208.67.222.222","208.67.220.220" - Configure Domain Name Server (primary DNS, secondary DNS) 
<< OK 

>> AT+CSTT="wap.cingular","wap(at)cingulargprs.com","cingular1" - Start Task & set APN, User ID, and password 
<< OK 

>> AT+CIICR     - Bring up wireless connection with GPRS - THIS MAY TAKE A WHILE 
<< OK 

>> AT+CIFSR      - Get Local IP address 
<< 10.190.245.172   - returns IP address assigned to your module 
<< OK 

>> AT+CIPSTATUS      - Get Connection Status 
<< OK 
<< STATE: IP STATUS   - returns status of connection, needs to be 'IP STATUS' before you can connect to a server

After you have context, you need to make a connection to the server and then send your data.

Code:
>> AT+CIPHEAD=1      - Tells module to add an 'IP Header' to receive data 
<< OK 

>> AT+CDNSORIP=1   - Indicates whether connection request will be IP address (0), or domain name (1) 
<< OK 

>> AT+CIPSTART="TCP","www.google.com","80" - Start up TCP connection (mode, IP address/name, port) 
<< OK 
<< CONNECT OK      - Indicates you've connected to the server - IT MAKE TAKE A WHILE FOR THIS TO BE RETURNED 

>> AT+CIPSEND      - Issue Send Command 
<< >                   - wait for module to return'>' to indicate it's ready to receive data 
>> GET / HTTP/1.1   - Send data - this example is an HTTP request for the default page 
>> Host: [url]www.google.com[/url] 
>> Connection: Keep-Alive 
>> Accept: */* 
>> Accept-Language: en-us 
>> 
<< data from server returned - Server will return data here

Source: why I have a PDP DEACT ??? SIM300C | Forum for Electronics

at command – SIM800L: AT+CIICR always goes to PDP DEACT state – Stack Overflow

SIM800 R14.18

OK

=========== AT+CIPSHUT ===========
AT+CIPSHUT
SHUT OK

=========== AT+CIPSTATUS ===========
AT+CIPSTATUS
OK

STATE: IP INITIAL

=========== AT+CSTT ===========
AT+CSTT="internet.vodafone.ro","",""
OK

=========== AT+CIPSTATUS ===========
AT+CIPSTATUS
OK

STATE: IP START

=========== AT+CGATT ===========
AT+CGATT?
+CGATT: 1

OK

AT+CGATT=1
OK

 

Source: at command – SIM800L: AT+CIICR always goes to PDP DEACT state – Stack Overflow

Kubernetes vs. Docker

The Symbiosis Between Kubernetes and Docker

The question, “Kubernetes or Docker?” in itself is rather absurd, like comparing apples to oranges. One isn’t an alternative to the other. Quite the contrary; Kubernetes can run without Docker and Docker can function without Kubernetes. But Kubernetes can (and does) benefit greatly from Docker and vice versa.

Docker is a standalone software that can be installed on any computer to run containerized applications. Containerization is an approach of running applications on an OS such that the application is isolated from the rest of the system. You create an illusion for your application that it is getting its very own OS instance, although there may be other containers running on same system. Docker is what enables us to run, create and manage containers on a single operating system.

Kubernetes turns it up to 11, so to speak. If you have Docker installed on a bunch of hosts (different operating systems), you can leverage Kubernetes. These nodes, or Docker hosts, can be bare-metal servers or virtual machines. Kubernetes can then allow you to automate container provisioning, networking, load-balancing, security and scaling across all these nodes from a single command line or dashboard. A collection of nodes that is managed by a single Kubernetes instance is referred to as a Kubernetes cluster.

Now, why would you need to have multiple nodes in the first place? The two main motivations behind it are:

  1. To make the infrastructure more robust: Your application will be online, even if some of the nodes go offline, i.e, High availability.
  2. To make your application more scalable: If workload increases, simply spawn more containers and/or add more nodes to your Kubernetes cluster.

Kubernetes automates the process of scaling, managing, updating and removing containers. In other words, it is a container orchestration platform. While Docker is at the heart of the containerization, it enables us to have containers in the first place.

Source: Kubernetes vs. Docker: A Primer – Container Journal