Connecting Aurdiuno ESP-01 wifi with led matrix MAX7219 - arduino-esp8266

01 has only 2 giop's and a tx,rx. How can I connect esp-01 to led matrix max7318 so that I can remotely display content.

Related

How to print Arabic text using network printer

I have tried to implement an Arabic language by using network printer. But When I am printing through a local printer directly connected to the Windows workstation, I am printing Arabic successfully since it is using the Windows drivers through print driver.
But, When I am printing through a network printer directly from the printer ip, I am unable to print Arabic.
from escpos.printer import Network
kitchen = Network("192.168.1.111")
kitchen.text(" اطبع هذا النص")
kitchen.cut()
also, I have tried to solve this issue using encode("utf-8"). Here is the code,
from escpos.printer import Network
kitchen = Network("192.168.1.111")
kitchen.text(" اطبع هذا النص".encode("utf-8"))
kitchen.cut()

Python serial port ussd command throw error

I am using pyserial with AT command to query a Huawei USB modem k3565. Some commands such as ser.write(b'at+cimi\r\n') return the imsi of the career. But when I try to get the phone number with the code below. It returns an error. Could it be my modem or platform(ubuntu 17.04) or my code.
In [35]: ser.write(b'at+cusd=1, "*99#", 15\r\n')
Out[35]: 23
In [36]: ser.read_all()
Out[36]: '\r\nERROR\r\n'

Grab the value of a tags attribute using bs4

I am using bs4 with Python3 to grab the details of a product searched on amazon ,
here is my code :
from bs4 import BeautifulSoup as BS
import requests
html = requests.get('http://www.amazon.in/s/ref=nb_sb_noss_2?url=search-
alias%3Daps&field-keywords=hp+monitors')
soup = BS(html.text , 'lxml')
#print(soup.prettify())
for i in soup.find_all('li') :
print(i.get('id'))
h2_tag = i.h2
print(h2_tag.get('data-attribute'))
print("_____")
With this code i am not getting the value of data-attribute attribute of h2 tag . Whereas the value of id attribute of li tag is coming out .
Can anyone tell where i am doing mistake .
Several things to say here:
instead of using html.text, use as recommended here html.content.
why would you use lxml here ? html.parser should be fine.
there is no need to use the data-attribute tag: you can just grab the text from the h2 using h2.text.
A simpler way to gather the product titles is directly iterating through all of the <h2> that have the s-inline class (the product titles):
from bs4 import BeautifulSoup
import requests
html = requests.get('http://www.amazon.in/s/ref=nb_sb_noss_2?url=search-alias%3Daps&field-keywords=hp+monitors')
soup = BeautifulSoup(html.content , 'html.parser')
for h2 in soup.find_all('h2', class_='s-inline'):
print(h2.text)
Output
HP 24ES 23.8-HP 24ES 23.8-inch THINNEST LED Monitor (Black)LED Monitor (Black)
HP 22es Display 54.6 cm, 21.5 Inch THINNEST IPS LED Backlit Monitor
HP 22KD 21.5-inch FULL HD LED Backlit Monitor (Black
HP 19KA 18.5-inch LED Backlit Monitor (Black)
HP 27es 27 Inches Display IPS LED Backlit Monitor (Full HD)
HP 21KD 20.7-inch FULL HD LED Backlit Monitor (Black)
LG 24MP88HV-S 24"IPS Slim LCD Monitor
Dell S Series S2415H 24-Inch Screen Full HD HDMI LED Monitor
Dell E1916HV 18.5-inch LED Monitor (Black)
HP 20KD 19.5-inch LED Backlit Monitor (Black)
Dell S2216H 21.5-Inch Full HD LED Monitor
HP V222 21.5" LED Widescreen Monitor (M1T37AA Black)
AlexVyan®-Genuine Accessory with 1 year warranty:= (38.1CM) 15 Inch LCD Monitor for HP, Dell, Lenovo, Pc Desktop Computer Only (Black)
Compaq B191 18.5-inch LED Backlit Monitor (Black)
HP 20WD 19.45-Inch LED Backlit Monitor
HP Compaq F191 G9F92AT 18.5-inch Monitor
Also, instead of using bold for inline code, use backticks like this:
`codecode` will be rendered as codecode
EDIT:
Here, soup.find_all('h2') would have gotten all h2 tags from the page, however the amazon page also has h2 tags for other elements than products. I just noticed that all products had the s-inline class, so soup.find_all('h2', class_='s-inline") will only take the h2 tags from products.

adding i2c device in raspberry pi device tree source

I am learning to add i2c devices in device tree of raspberry's kernel 4.4.8. After successful compilation of DT, raspberry pi is not allowing me to log in to board.
showing "ssh: connect to host 10.1.1.103 port 22: Connection refused".
I have linked dt sources below
DT Souce.
one by one, I tried adding in all following files.
in file bcm2708-rpi-b.dts line 93. (lm75#48).
in file bcm2708-rpi-b-plus.dts line no. 87.
in file bcm2708.dtsi line no. 44.
Please help me. Any help will be appreciated.
Thanks.

PySerial "better" port names for Linux?

Followup question to this: permanent USB port names? (Linux)
On Windows the port names don't change between actual physical ports. They are along the lines of "COM3", "COM6", etc.
On Linux, if I plug one USB device first , it will be "ttyUSB0" and if I plug the same device second in any other physical port it will be "ttyUSB1". That won't work if I want to, say, have 2 Arduinos connected via Pyserial to the PC.
In the above answer I was shown a way to get an IP-like "serial name". How can I feed that to the PySerial class instead?
An example:
import serial
ser = serial.Serial(port = "/dev/USBNAME", baudrate=9600)
ser.close()
ser.open()
if ser.isOpen():
ser.write("test")

Resources