Thursday 29 December 2022

Christmas weather station?

 Well, a parcel from Ben arrived today, and apparently it is the components for a weather station. 

[11:30, 29/12/2022] Ben Grant-Jones: Yes, looks about right. Does it have an Arduino, a screen and various sensors?

[11:36, 29/12/2022] Ben Grant-Jones: I think it's called an Ideaspark weather station kit.

https://www.hackster.io/alien-energy-3/what-do-i-build-next-a-simple-weather-station-cdc4ed

The wiring schematic is here

[11:37, 29/12/2022] Peter Merchant: Looks like 4 sensors, a computer board of some type, and other bits.

The computer in it is a LoLin NodeMcu v3.  Onwards and upwards!

Let's look at that Hackster  site and see how I'll put it together and what power supply is required. I think that that power converter that Ben sent in a previous parcel will be required here for 3.3V.

30/12/22 Bits included are:

A very small screen. I can't find a part number on it.   4 pins for power and serial comms. 

GY-30 Light intensity sensor. Also  5 pins for power and serial comms + ADO?

GY-68 180BMP Atmospheric pressure sensor.  4 pins for power and serial comms. 

11DHT (Possibly) Temperature humidity sensor. 

I think it is this: 

https://www.amazon.co.uk/Temperature-Humidity-Atmosphetic-BH1750FVI-YellowBlue/dp/B07GPBBY7F/ref=sr_1_13?crid=VBUYHQW3XS8M&keywords=ideaspark&qid=1672402295&sprefix=ideaspark%2Caps%2C81&sr=8-13

Have downloaded demo software from Blog site.

A BAD NIGHT:  Arduino IDE seems to have disappeared from my computer. I installed  Arduino IDE version 2.01, and it does not have my board, and the Boards manager is not present.   Time to give up for tonight.

Removed Arduino IDE 2.0? and installed 1.8.19

Installed the following libraries to get the hardware and bits to get it to compile

ttps://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json, https://arduino.esp8266.com/stable/package_esp8266com_index.json, 

https://github.com/vlast3k/Arduino-libraries/blob/master/SSD1306/SSD1306Wire.h

It gets over this now, and has an error with:   ESP8266_Weather_Station/src/ESPHTTPClient.h:4:10: fatal error: HTTPClient.h: No such file or directory

Other people who have done it:

https://randomnerdtutorials.com/cloud-weather-station-esp32-esp8266/

https://github.com/ThingPulse/esp8266-weather-station   [ this might be the one used here]

https://thingspeak.com

23/1/2023 - Working through the compilation: 

fatal error: SSD1306Wire.h: No such file or directory

this is installed: SSD1306 oled driver library for the Wemos Mini OLED shield (64x48)

but is it the right one? 

Installed:  / esp8266-oled-ssd1306

That got a lot further, but now:

WeatherStationDemo:70:21: error: 'D3' was not declared in this scope

   70 | const int SDA_PIN = D3;

and same with D4. 

Changed from Generic 8266 Module to Lolin Wemos D1,R2 and Mini

That Verified!  Let's program it. 

25/1/2023

Now all wired up, and connected to Wifi, displaying forecasts. 

There is an error in the wiring diagram in the Hackster weather station that I am building.  The Ground and VCC of the display go to the wrong pins. 

Next step is to look at software and see how to get to read the sensors.

NOTE: when I load software into the Arduino IDE, change board to ESP8266 -> Lolin (Wemos ) D1, R2, and Mini

#define TZ              0       // (utc+) TZ in hours
*** Bad one - later TZ is multiplied!
TZ=0 gave UTC+1, 
TZ= 1 gave UTC+2

But have I not set up something correctly. 

String OPEN_WEATHER_MAP_LOCATION = "London,GB";

STEP 5  Register OpenWeathermap, thingspeak new account

https://github.com/ThingPulse/esp8266-weather-station/blob/master/examples/WeatherStationDemo/WeatherStationDemo.ino
gives a link to Thingspeak to get the API code for the weatherstation. 
I have put this in the .ino file. 
Now I believe i need to select the weathermap location. 

const char *host = "api.thingspeak.com";                  //IP address of the thingspeak server

const char *api_key ="c4b7d4b2331c0baac3e329358384e378";                  //Your own thingspeak api_key

This one is wrong I think

and this one is correct:

String OPEN_WEATHER_MAP_APP_ID = "c4b7d4b2331c0baac3e329358384e378";

String OPEN_WEATHER_MAP_LOCATION = "2633863";

Time is now wrong by +2 hours and all data is set to 0.

and the next few days info is all thurs,thurs,thurs, so something has gone wrong with the timing.

from here: https://nothans.com/thingspeak-documentation/api

In order to update a channel, you need to know your Write API Key. If your Write API Key gets compromised you can generate a new key.
Follow these steps to get your Write API Key:

  • Select Channels
  • Select the Channel to update
  • Select Manage API Keys      
There is also a read API Key. I don't know which I need here. 

On the thingspeak channel display I can see that all sensors are displaying some changes. Success!

--------------- --------------- ------------ -

26/1/23  Got time right. Had to set TZ to -1.

Have to use 'write' API key to write things to thingSpeak. 


This is what serial monitor shows:

temp:18    humi:62

light: 165

Pressure = 103155 Pascal

temp:18    humi:62

light: 165

Pressure = 103153 Pascal

temp:18    humi:62

light: 165

Pressure = 103154 Pascal

temp:18    humi:62

light: 165

Pressure = 103145 Pascal

SO why doesn't it display!

27/1/23 Changed Channel view from private to public, but it still doesn't display, so it doesn't read the stuff. 

29/1/23  Current state.
There are three things, 
1] It gets and displays the time     --Yes
2] It reads the sensors and writes them to Thingspeak  --Yes
3] It reads the weather forecast from OpenWeathermap and displays it on the two screens.   --No. 

Some other sites that may give some help:

https://randomnerdtutorials.com/esp32-http-get-open-weather-map-thingspeak-arduino/

https://forum.arduino.cc/t/arduino-uno-esp8266-01-and-openweathermap-org-for-weather-monitoring/458438
 -- waste of time.

https://www.instructables.com/Esp8266-Weather-Data-Parser-Openweathermap/
 - This uses a totally different TFT screen and would be far too much work to convert. 

Tried it with the Thingspeak API read key for Openweathermap - didn't work.


30/1/2023  End of. Going to leave this project for a bit. 







Tuesday 8 November 2022

New Project - Reprogramming/fixing a Smart WiFi Socket

Following on from discussions on Twitter, I think that I should do this. 

It uses Tasmota devices and MQTT  to show what is using power when. 

An excellent writeup  by @Brunty in his blog:  https://brunty.me/post/energy-monitoring-2022-edition/

To start I need some Tasmota devices. They ain't cheap.

Can I convert my TUYA Smart devices to Tasmota. @Andysc says I can. Will I still be able to control them to turn TV ON & off at specified times automatically? 

There is Tasmotrol, but it is written by a person (Yvonne Joh) who I don't know anything about. Does it feed stuff back to China like TUYA Smart? 

I will need a home Server running 24/7, and at the moment all I have is a few spare black tower PC's. 

Can I find a small unit that plugs into a mains socket and will support some storage?   Looked for 'PC in a plug' and found some references to things like Sheevaplug, but they all seem to have ceased. 

I'll have to get a Raspberry Pi to fit into my dead Humax box when they are available. 

Suggestion that I should look at Balena_io and MING. I might have to learn some more programming if I went that route. 

Keep thinking about it.  Have discovered that Enphase uses MQTT, but I think that this is in old versions of the software. Good if it still does.  How can I test it?

21 Nov. 22

Going to flash one of my TUYA smartplugs with Tasmotrol.

The device is a https://expo.tuya.com/product/627497  model J2-SU-E16

Following https://www.superhouse.tv/44-over-the-air-tasmota-conversion-with-tuya-convert/

Setting up Rasberry Pi (10) 

It has flashed, Not sure if it was successful. 

When plugged in, no light. But Wifi Network tasmota_02AC61-3169

MAC address 12:e9:be:e7:26:65


Have left a comment on the superhouse web page.

26 Nov 22. Have taken it apart and discovered that the chip in it is a common Popular one ESP-12S, and have unsoldered it from the unit. Have ordered a USB to TTL serial interface board so that I can program it. 

Best link that I have found is: 

https://templates.blakadder.com/ESP-12.html

This one has videos of programming them. 

https://www.hackster.io/brian-lough/3-simple-ways-of-programming-an-esp8266-12x-module-c514ee


29 March 2023 looking at this to make it simple:

https://www.youtube.com/watch?v=8yxEgYvoHY0

I have now found tasmotizer:

-- peterm@peterm-MBB-34204H:~$ find -name "*tasmotizer*"
-- ./.local/bin/__pycache__/tasmotizer.cpython-38.pyc
-- ./.local/bin/__pycache__/tasmotizer.cpython-310.pyc
-- ./.local/bin/tasmotizer.py
-- ./.local/lib/python3.10/site-packages/__pycache__/tasmotizer_esptool.cpython-310.pyc
-- ./.local/lib/python3.10/site-packages/__pycache__/tasmotizer.cpython-310.pyc
-- ./.local/lib/python3.10/site-packages/tasmotizer-1.2.1.dist-info
-- ./.local/lib/python3.10/site-packages/tasmotizer_esptool.py
-- ./.local/lib/python3.10/site-packages/tasmotizer.py
-- ./.local/lib/python3.8/site-packages/__pycache__/tasmotizer.cpython-38.pyc
-- ./.local/lib/python3.8/site-packages/__pycache__/tasmotizer_esptool.cpython-38.pyc
-- ./.local/lib/python3.8/site-packages/tasmotizer-1.2.1.dist-info
-- ./.local/lib/python3.8/site-packages/tasmotizer_esptool.py
-- ./.local/lib/python3.8/site-packages/tasmotizer.py

But it won't run because it is missing some bits

following instructions to install tasmota from web i/f But it cannot find USB serial port. 

https://tasmota.github.io/docs/Getting-Started/#needed-software

Web:  https://tasmota.github.io/install/

Have downloaded basic Tasmota from http://ota.tasmota.com/tasmota/release/

This nearly works with the TTL-USB dongle that Ben gave me. It didn't react with Mine. 

Here is another story about step-by-step programming a device with Tasmota.

https://blog.horner.tj/emporia-smart-plugs-tasmota/

This tells how to set Bootloader mode on GPIO15 (pin10)

https://docs.espressif.com/projects/esptool/en/latest/esp8266/advanced-topics/boot-mode-selection.html

7 April 2023.

So I need GPIO-15 Pulled low to enable flashing. This is the pin next to GND. 

SUCCESS!

Following a hint online:

sudo apt-get install python3-pyqt5.qtserialport

and now this works:

 python3 ./.local/lib/python3.8/site-packages/tasmotizer.py
and brings up tasmotizer. 

But I need to find the config file. 

On TAsmotizer, just click the little box for the section that you want to config, so I did and added the Wifi credentials, and then 'saved' this config, which sent it to the device.   Fing found it, but the tasmotizer tablet app didn't. I think I need to set up a tasmotizer web server for this, which probably means using a Raspberry Pi. 

Correction: Fing did not find it. and searching for a WIFI connection to it found nothing either. 

Wrote to Horner re my problems

Hi, as suggested in your blog on this, I am asking for the benefit of your experience. I have an unbranded Smart Switch with TUYA software. It is very similar to the Lombex unit: https://templates.blakadder.com/lombex_U11.html.   I have removed the ESP12 microprocessor and connected it to my Kubuntu computer, and have been able to flash it using 

https://tasmota.github.io/install/   It was necessary to connect both GPIO-15 and GPIO-0 to 
ground to get it to flash. and then have started Tasmotrol to configure it, which seems to work. 
I then tried to send the generic module configuration, and that transferred. The problem is that the 
device never appears in my wireless network  - testing with fing on my tablet. 

Not sure what other info I can give you to help. Attached is a picture of the connection.
 
The ESP-12S came out of the slot on the main board of the unit. 

Any thoughts appreciated,
------------------- ---------------- ------------
another similar plug:
https://templates.blakadder.com/silentnight_485418G.html 

with a comment that  New Tuya devices have replaced their Wi-Fi module with one incompatible 

with Tasmota!!!

10/4/23 Likely conclusion: None of the Tasmota buolds loaded  have had wireless working, so my 

supposition is that Tuya are using an ESP-12 in this device that uses the Realtek wifi drivers rather 

than their original ones. 

I am going to test this hypothesis using these three links:

1]  https://www.instructables.com/Getting-Started-with-the-ESP8266-ESP-12

2]  https://www.instructables.com/ESP-12E-ESP8266-With-Arduino-Uno-Getting-Connected/

3]  https://circuitjournal.com/programming-esp8266-over-wifi

This one 3] is about working with these variants ESP-12E / ESP-12F / NodeMCU so I'll leave it for now. 

2] is about an 8266 E and builds on 1] so I'll start there. 

It has a warning about not using the 3V3 from the USB-TTL adapter as it doesn't supply enough power. 

I cannot get the Arduino IDE serial monitor to  show anything. 

Trying to get an Arduino program working for the ESP8266, and I just get this error:

"module 'time' has no attribute 'time_ns'" in /tools/mkbuildoptglobals.py  and can't find a cure. Something to 

do with the version of Python perhaps. 


16/4/23  Interesting teardown of a couple of smart plugs:

https://www.hackster.io/news/teardown-of-a-smart-plug-or-two-6462bd2f275b

The TCP-Smart plug that I have  contains this:

https://developer.tuya.com/en/docs/iot/wb2s-module-datasheet?id=K9ghecl7kc479

and looks like this. 











2023-05-19

Discovered a new article about programming an ESP-12 with Tasmota

https://www.elektroda.com/rtvforum/topic3816654.html

It implies that the  WB2S in the TCP switch has to be replaced with an ESP-12 device.











 





Tuesday 1 November 2022

Second try at CTC DIY 3D printer Z-axis wobble fix

25/3/2023 Don't bother reading this. I gave up when I never could communicate via the Arduino to the ANET board.

-------------- ------------------- -------------- --------------- 


I am going to try and start again. 

I think that I have prepared the Arduino Uno for use as a downloading tool.

I now need to find the Library/Hardware data for this ANET  V1.5.

Basic configuration:

/Home/peterm/Arduino/arduino-ide_nightly-20221020_Linux_64bit.AppImage

/Home/peterm/Arduino/Hardware/anet

/Home/peterm/Arduino/libraries

/Home/peterm/Arduino/Marlin-2.1.1

Set Preferences Additional Board Manager to https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json

 And installed in Boards Manager the MightyCore.

Then in Boards Manager I was able to select ATMega1284 which is what this ANET card has. 

I think that I have to load some additional Configuration files from somewhere to select the file for my ANET board. Need to look that up again. 

Found that here: https://github.com/MarlinFirmware/Configurations

Following along from this, with modifications.

https://www.youtube.com/watch?v=38PkynA1uGI&t=157s   at 3:00 in

His file links:     * Software links

Marlin firmware https://github.com/MarlinFirmware/Marlin Marlin Default Configuration Files https://github.com/MarlinFirmware/Con...

from 5  minutes in, he wants you to download Visual Studio. It is available for linux. 
https://visualstudio.microsoft.com

Just after 8:00 mins he refers to another link in order to get the bootloader onto the  ANET board. I may have to do this first. 

------------ ----------- ------------ -----------
2022-11-04
Going back a step to get the bootloader in. 
https://www.youtube.com/watch?v=RQIizXtf9oo&t=0s

This also does the MArlin firmware to the printer, after getting the bootloader in. 
3:10 Arduino as Programmer to 4:40
4:45 wiring to ANET board
5:30 Burning bootloader
6:10  burning MArlin firmware to board. 


at 5:42 cannot find the ANET  optiboot in the boards manager. 
from the comments:
Arduino 1.8.5 it didn't have the anet boards listed. I found how to add those at https://github.com/SkyNet3D/anet-board. [ 2023/7/14 This link has disappeared]
Followed these instructions, but I had already done them, but the IDE does not seem to find the hardware folder.

BAH: Its a known fault: https://forum.arduino.cc/t/hardware-folder/699133

------------ -------------- -------------- ----------
2022-11-06
- removing Arduino IDE 2  Appimage
- removing /Hardware directory
- removing /Library directory

Download Arduino IDE 1.8.19  https://www.arduino.cc/en/software
There is a link to the installation instructions
Open console, run sudo sh install.sh
Now to find Hardware folder. 

OK, it's in /Arduino/Hardware and I have added the ANET stuff. 


2022-11-28 
It looks like the Marlin firmware compiles /verifies Ok with the MightyCore  Atmega chip specified, but it won't download via the Arduino. I will have to rewatch the video.  

2022-12-01
IT verifies and tries to load only if the capacitor to the reset pin is not connected to ground.  

error message:

avrdude: Expected signature for ATmega1284P is 1E 97 05

Double check chip, or use -F to override this check.


Two things I have learnt today. 


Folder /peterm/Arduino/hardware must have a lower case h on hardware. 

Putting the Anet folder from /home/peterm/3D_Printing/CTC-Prusa-i3-Pro-B-Anet-board  

into the hardware  folder means that Arduino IDE finds the ANET boards. 


This does Verify, but doesn't download because of 

Arduino: 1.8.19 (Linux), Board: "Anet V1.0"


Sketch uses 54624 bytes (43%) of program storage space. Maximum is 126976 bytes.

Global variables use 2475 bytes of dynamic memory.

avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x1c

avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x1c

An error occurred while uploading the sketch



This report would have more information with

"Show verbose output during compilation"

option enabled in File -> Preferences.


So I need to find out how to get it in sync.

I had the connector to the ANET board in the wrong position (one set of pins down from where it should be.) When I put it in the right place I fried the UNO.

Thought: I had the MISO/MOSI pins in the wrong places. 

-------------- -----------
Now to try using the special card that I bought. 
referring back to this:
https://www.youtube.com/watch?v=oZVTYpHnpIw  

I somehow need to determine the use of the pins on this USB to TTL device.

One reference: 
https://support.th3dstudio.com/helpcenter/anet-bootloader-flashing-guide-usbasp/





Another useful site for Arduino, but no help with my current problem

https://www.circuito.io/blog/arduino-uno-pinout/


I will try TX to MISO, and RX to MOSI
TX is Blue to pin 3, 
GND is Grey to pin 8
and RX is purple to pin 6

6/12/2022  Discussion at DLUG Meeting. to use MISO/MOSI i use a JTAG protocol.
I will be sent some information. 


22/12/22 
Some links found by Ben
https://www.thingiverse.com/groups/anet-a8-prusa-i3/forums/general/topic:33728


https://anet3d.com/blogs/download/open-source-firmware-of-a8


14/1/23  
After blowing up the Arduino Uno,
I am preparing another with an ICSP cable as per this:

https://www.instructables.com/Arduino-ICSP-Programming-Cable/






Summary:
Bootloader is downloaded to Arduino UNO.
Cable as above connects to ANET board. 
Marlin 2 Firmware compiles
MArlin firmware fails to download to board with error 
 -    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
and I don't know which item is not in sync. 

Question. Is the fact that  the Arduino is connected to the ANET board via the ICSP connections inhibiting the connection? 

Question 2: I have uploaded the AVRISP firmware to the arduino to act as the bootloader for the ANET board, but is the next step to use this to upload a bootloader to the ANET board and then use that to upload the Marlin Firmware?   I'll have to review one of the videos. 

2023/1/18 Discovered an error in creating that cable. I should disconnect the +v line so that the Arduino is not getting power from both the USB and the destination card.  I will replace the pin with a dummy one.   And another. The -ve side of the capacitor was connected to the grey (MOSI) wire, not the white ground wire. I blame that on the poor lighting. 

2023-1-20   Created a straight through  5 pin cable with a dummy pin holder where the +V is labelled.
It 'nearly' worked. I have seen this error before. 
"avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override
An error occurred while uploading the sketch
         this check."

I need to find this previous occurrence and see what I can do.  It wasn't far back, but didn't give me a solution.
I notice that the screen is flashing alternate lines. 

One solution suggested was to use a capacitor on the reset pin, As I have tried. 
Another was to reduce the version of the AVR tools to 1.6.9. That had exactly the same error so I reverted to the highest version. 

I might look at the software for the  device signature. 

Tried to burn a bootloader. Got error:
"Error while burning bootloader.
Reading | ################################################## | 100% 0.02s

avrdude: Device signature = 0x000000
avrdude: Yikes!  Invalid device signature.
         Double check connections and try again, or use -F to override   this check.  "

Not quite sure where to report this in order to ask for help.

23/1/2023
Removed the Reset line from the ICSP and connected it to pin 10. 

Then set  it up and got this error:
"avrdude: Expected signature for ATmega1284P is 1E 97 05
         Double check chip, or use -F to override this check.
Wrong microcontroller found.  Did you select the right board from the Tools > Board menu?"

Seen this before. 

But, it's RTFM time. I found this:
https://docs.arduino.cc/built-in-examples/arduino-isp/ArduinoISP
and at one point it says:
Going through the lines of the sketch you find a number of parameters that need to be set according to the target board. These parameters are, however, set by a specific file available for each bootloader/board supported by the Arduino Software (IDE). 

So do I need to edit this file?   No, I don't think so.


24/1/2023   I swapped the lines  MISO/MOSI  so that they are a crossover cable , but got the same error.

Looking around  for ways to read the signature for my ANET I found this: 

https://arduino.stackexchange.com/questions/23751/using-arduino-uno-to-retrieve-atmega328p-pu-chip-signature

https://www.instructables.com/How-to-Fix-Expected-Signature-for-ATMEGA328P-Is-1E/


20/3/2023  Had a thought about whether I could use my USB to TTL adapters to program the ANET card. The answer is NO. They do not support I2C communications. No clock line. 

Continue with Arduino UNO. 

ANET                                                                               UNO


o                      o                                                      o                    o
                                                            (violet)    MISO             VCC


o                      o                                                      o                    o
GND             Reset                              (black)    SCK      (blue) MOSI
(grey)            (brown

o                      o                                                      o                    o
MOSI            SCK                                              RESET      (grey) GND
(violet)          (black

o                      o                                                      
VCC              MISO
N/C                (blue)

o                      o                                                      

------------------------- ------------------------ -------------------



Today I am thinking of working through this to put a bootloader onto the ANET board. 
https://www.thingiverse.com/thing:4462696

see other blogs
-------------------------

6 October 2023
Bought  a metre long M8 threaded rod from Jewsons and cut it into 3. Replaced riser rods with these in other universal joints. It still wobbled. It is to do with the motors and connection to the rods - needs thought.












Wednesday 14 September 2022

Old Humax 9150T as Raspberry Pi PVR

 Humax PVR is dead. NVRAM has failed so it won't store configuration or recording schedule.   What can I do with it? 

It has hard disk, and Power supply and plenty of room inside. 

https://magpi.raspberrypi.com/articles/pivr-pi-pvr    It has been done before. 

This calls for a powered USB hub. 

I'll need USB-SATA connection. 

How much power can I get from the Humax PSU?   Need to suss out the pins. 

If I used a R-Pi 3B+  it would have wireless. 

Humax PSU has 8 wires running from it,  4 are +12 and 4 are Ground. Each set of four is all connected together on the PCB. 

I have bought a dual 5V converter module so that I can give 5 volts to the R-Pi and 5 volts to the SATA disc.      23/9/2022 - This has arrived as has a USB to SATA converter.  So now the hard disk can be connected to the driving computer. 






Saturday 21 May 2022

CTC DIY 3D printer Z-axis wobble fix.

25/3/2023 Don't bother reading this. I gave up when I never could communicate via the Arduino to the ANET board.

-------------- ------------------- -------------- ---------------  


From the beginning this printer had a z-axis wobble. It was visible in the way that the screws precessed as they turned. I have tried a number of fixes, but lately have seen that an IBM person on twitter had a fix. He told me to replace the Z-axis screws with proper ones. 

This I have done, and also the adapter that connects to the stepper motor. These screws seem to have a much coarser thread than the original screws, partly because they are 'two-start' threads. 

Now it seems I have to change the control board firmware, and as I am told 'Here be  dragons' 

I have got the Marlin firmware from Github version 2.0.9.3

https://github.com/MarlinFirmware/Marlin

The usual instructions for loading the firmware suggest using the Arduino IDE (I have this), and setting it up for the board that I have. First Dragon: there is no identification on this board, or in the manuals. 

The Board is I think an ANET3D judging from findings on the Internet. 

Picture here: https://grabcad.com/library/anet3d-v1-5-control-board-1#!

And someone debugging it here: https://jestineyong.com/fixing-a8-anet-3d-v1-5-mainboard/

The chip on the board is an ATMEGA 1284P.  Does the Arduino IDE recognize it?  Noooo. 

https://forum.arduino.cc/t/atmega1284p-with-arduino-ide/485720

Ooh, maybe: http://www.technoblogy.com/show?19OV

It suggests that I use https://github.com/JChristensen/mighty-1284p/tree/v1.6.3

which tells me to download the zip file and put it in the Arduino Hardware folder, which I cannot find.  I am using Arduino vn 2. Is that the problem?  

/home/.arduino/plugin-storage/mighty-1248p-1.6.3    change to mighty-1248p

------------- -------------- -------------

A way to get the 1284P recognized:

[1]   https://www.youtube.com/watch?v=lAKyZd63_ns         from about 7:15 in

Compilation error: Error resolving FQBN: missing platform release arduino:avr referenced by board Sanguino:avr:sanguino}  

NOPE!

------------ -------------

Came across this: 

[2]   https://www.youtube.com/watch?v=vG23IHKiaSk

Not entirely happy as it needs an Arduino as an interface to the control board. And a change of screen for the Marlin firmware. Is that going to be necessary? 

at 5:10 in it shows the pins to the ANET board. 

2x5 connector

                                      o  o

Bk Gnd     Gnd              o  o     Reset    Pin 10

Yl  Pin 11  MOSI          o  o      SCK    Pin 13   Or

Red  pinV5   VCC        o  o       MISO  Pin 12  Gn

                                      o  o

Apparently on the Arduino, you need to do something with the reset pin. This video does not explain that. The video does not use the Arduino.     (comment below *Cap)

---------- ------------- -------------

Found a manual that shows use of these menus. Did a search for I3 Pro B.

https://www.geeetech.com/Documents/Geeetech%20Prusa%20I3%20pro%20B%20user%20manual.pdf

But nowhere to save changes in config.

Wrote my own configuration manual  photographing all the screens, but cannot find a save config item.

--------------------------------------

My 'friend' who says  beware dragons has written

"I tried everything! I'm on marlin V1 once you get it on them it's easy to update. But getting it installed in the first place requires a blood sacrifice.i bought 3 different usb programmers and I honestly can't remember how I eventually got it installed. It was a nightmare :("

so I don't think I'll get much help here.

-----------------------

From the links in the files I get to: https://reprap.org/forum/read.php?415,889546

where someone seems to have the same prob. I have made a change recommended there.

The very first thing you should set in a Configuration.h is the #define MOTHERBOARD
This is set to BOARD_ANET_10

**** July 23 Done.

Trying to verify still gets the error. Now I find this that I'll have to think about.

https://forum.arduino.cc/t/solved-sanguino-1284p-chip-for-ender-2/600455/6

----------------------

How to set up the board to be programmed:

[3]   https://www.youtube.com/watch?v=oZVTYpHnpIw        about 8 minutes in it tells how to program the arduino board. 

This ANET3D board has a 2x3 row of holes labelled USB BLE which I think is the serial program link

No It is the 2x5 socket next to the display socket. See above.

I was able to select the board and port, but could not verify it because it could not find a FQBN. I needed to install more firmware for my UNO

Processing Arduino AVR Boards:1.8.5: Downloading arduino:avr-gcc@7.3.0-atmel3.6.1-arduino7

Now it verifys correctly. And uploaded very quickly.


----------------

Oo, look what I found!

[4]   https://github.com/mytja-archive/CTC-Prusa-i3-Pro-B-Anet-board

And the manual - there is a link - has a store memory function. 

------------- ----------

Using [3] I have programmed the arduino board as a bootloader. This is shown at about 8 minutes.  And it tells how to use this to download the Marlin firmware to the controller. 

Now I am trying to find how to verify the marlin firmware in the Arduino IDE. I have 2 copies of Marlin firmware.  2.0.9.3.  and 1.1.8

 see [1]  5:19

in 2.0.9.3 marlin

marlin/src/core/boards.h from about line 174

I might choose board sanguinololu

23/10/22  Marlin 2.1.1 does not have a boards.h file that I can find. I used BOARD_ANET_10 as noted  above. 

--------------- ---------------

A search for 1284P found this: 

https://github.com/MCUdude/MightyCore

and I have downloaded  it. 


https://github.com/MCUdude/MightyCore

Open the File > Preferences menu item.

Enter the following URL in Additional Boards Manager URLs:

https://mcudude.github.io/MightyCore/package_MCUdude_MightyCore_index.json

Separate the URLs using a comma ( , ) if you have more than one URL

Open the Tools > Board > Boards Manager... menu item.

Wait for the platform indexes to finish downloading.

Scroll down until you see the MightyCore entry and click on it.

Click Install.


Verify gives an error:

error: statement-expressions are not allowed outside functions nor in template-argument lists

The error relates to a file  in MCUdude in .arduino15  but I am using Arduino 2.0.0-rc3 so why  is it calling into .arduino15?


---------- ---------------

Found a video about upgrading the ANET board. 

https://www.youtube.com/watch?v=MLAN7gWuRCs         differences between v5 and v7

This leads to this video about putting Marlin Firmware on to the board. It sounds feasible:

https://www.youtube.com/watch?v=wRODgnAqp1A&t=0s    

4 minutes in, download the board  definition files for ANET for arduino.  (Sanguino)

https://github.com/SkyNet3D/anet-board

But no hardware folder in Linux, so copied it into Libraries. It is called avr.

at 5:33  things do not work as described

Used folder /libraries/ANET/avr    and try again.

folder/libraries/anet and found it right at the bottom, not in alphabetical order

From about 9 mins in. 

Copied the example files for the ANET8 to the Marlin folder.


That was the preamble video to this:

https://www.youtube.com/watch?v=ePgpzkjriso

What I need to know are which files of the marlin software I can delete as so many of them are for dufferent languages.  Also how to configure the software for my particular model. 

I have deleted Arduino 2.0.0 rc3 as it kept hanging the computer and installed Arduino 2.0.0. rc8. 

Also have started using Marlin 1.8 software. 

*** July 23 updated to rc9 Arduino IDE. 


from youtube reference [3] above, have downloaded bootloader to UNO, abut now cannot burn the Bootloader because of errors: Failed chip erase: uploading error: exit status 1avrdude: Error: Could not find USBtiny device (0x2341/0x49)

will try again later. 

Do not need to burn bootloader to device, Just need to use Uno Bootloader to update Anet card. 

More later - As the famous line goes ' more work needed here'

Comments from a Thingiverse forum user:

madmachinations just commented on Big Upgrade on CTC DIY Printer - Help needed to Install Marlin. in CTC 3D Printer Owners

So I don't know for sure because I've never tried using that board, but a quick google seems to be indicating that the ATMega 1284P has 128kb of program memory available.

I think I remember reading that Marlin 2 really wants 256kb. Iirc people did get Marlin 2 to run on Anet boards with less space by turning stuff off and chopping stuff out.

So you could try and earlier version of Marlin if you're having build/load issues.

Z-axis wobble is one of those dreaded problems that can be due to all sorts of things, most likely something physical though. But if your threaded rods were more like giant bolts than actual threaded rods, like they tend to be in these cheap kits, then changing them is a good step forward for sure.

When your printer is activating any of the stepper motors on your printer, it's obviously looking to move the associated axis a very precise distance.

So how does Marlin know how to do that? Well you have to calibrate each axis, and you have to calibrate the extruder too.

The process for doing this is basically to:

1) Run the M92 gcode command on the printer, this will spit out the current calibration numbers for each axis, note these down. 2) Place a ruler next to the hot end carriage, make a note of how far off the bed the top of the carriage is. 3) Tell the printer via it's menu to move the Z axis up by 20mm 4) Measure how far the carriage actually moved up 5) Calculate the new calibration figure for that axis with:

new_calibration = (expected_mm_moved / actual_mm_moved) * original_calibration_number

so we tried to move Z up by 20mm, lets assume it moved up by 12mm. Let's assume the original calibration number for the z axis was 62:

new_z_calibration = (20 / 12) 62 new_z_calibration = 1.666666667 62 new_z_calibration = 103.333333333

So in this example our new Z calibration number would be 103.33

[ couldn't do this, but I recorded all the values from the menus]

6) Set this new calibration figure on the printer for the Z access by running the gcode command M92 Z103.33. You can set this command to run before every print you export from your slicer, inside your slicer's settings. You can also set the "steps per unit" in Marlin's configuration file and flash a new build onto your board. However, this approach with a ruler is very inaccurate, and really is just the first step to calibrating an axis after you've lost the original calibration.

7) With your new Z calibration set, print a test cube, something with consistent and known dimensions. Then use a micrometer to measure the resulting cube on the Z axis when it's done printing. If the cube was supposed to be 30mm high and it has produced something 28mm high, then you use these figures to perform the same calculation again as was done with the ruler.

8) Use the M92 command again to set the refined Z axis steps-per-unit figure, or put the refined figure into Marlin's config and re-flash your board. You can use this same cube to refine your X and Y calibrations while you're at it.

If you search youtube for "Marlin calibrate steppers" you will see lots of tutorials for this and for calibrating the extruder with a similar process too.

When it comes to building Marlin itself, the way I did it was to try and find the closest off the shelf config I could and modify it. But it was still a lot of trial and error to really dial it into the way my printer actually is.

I did write a tutorial for building Marlin on these strange CTC kits, my board is different to yours but the process will be similar:

https://www.thingiverse.com/thing:4475743#Step%207%20-%20Test%20printer

The main difference that doesn't apply to you though is where I'm targeting the mega2560/gt2560 board for my builds. You'd want to substitute that bit for the mega1280.

Good luck!


3/8/22  *Capacitor comment.  From https://www.thingiverse.com/thing:4462696  I find where to connect the cap to the reset. I used a 10uF 25v capacitor.

26/9/22 Have edited Configuration.h for the ANET8, using values from the configuration manual I created from the existing config. 

going to move this into the Marlin folder.  and the Config.adv.h file too. 


18/10/22  Back on it. From  https://github.com/jeko89/anet_for_arduino

Have put Anet folder into /peterm/arduino/Hardware folder. 

will also copy to root/usr/share/Arduino/Hardware

Start IDE.  Still cannot find Anet hardware, even with Anet board connected and live.

IDE does not show boards manager. It is IDE 2.1.0.5     [NO, it is 2:1.0.5}  so it is a very old version 1.

Have removed the IDE using synaptic, and downloaded the latest AppImage  and it comes up OK,

Now to look back and see how to find my Anet board in it. 

22/10/22  Appimage loaded very slowly with Marlin 1.1 sketch. A test by editing and saving a simple sketch shows that the IDE will load fast, so I have removed all excess language files and also pins files from the folder. 

Loading that still takes a long time.  Not nearly as long though. 


Even though I have put the MightyDude link in the preferences, it cannot find the library. 


As per suggestion on Arduino forum, I am going to try MArlin 2.1.1  from

https://github.com/MarlinFirmware/Marlin/releases/tag/2.1.1

It loads into the IDE in seconds, and only loads 4 files.

---- - - - - - - 

24/10/22  I think that I need to know more about how the IDE works. To set it up for a new piece of hardware, the ANET card with the 1284 processor, I need to install both a library and the hardware. I do not know which should come first, or even if the hardware should be plugged in to the IDE before setting it up.  One idea is that I somehow need to install the library, and this enables the hardware so that it can be found. 

https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-installing-a-library

But how do I get the name of the library?   Need to see an example where this is done.  

-------------- ------------ -----------

30/10/2022  Found this and working with it. It answers some other problems that I didn't know that I had. 

https://www.youtube.com/watch?v=38PkynA1uGI

It refers me to another video to download a bootloader to the Anet card: 

https://www.youtube.com/watch?v=RQIizXtf9oo  at about 5:36 in after getting the first bootloader on to the Arduino card. 

steps:

In Arduino, Open Sketch   ??? 

Tools Manager - Open  Anet v.1. Optiboot

I need to go back one step and find the Marlin boards thing














Monday 28 February 2022

Build my own electric bike?

 Not a Swytch bike, but build it myself.

I have aslways wanted to learn to weld, and this might be the project that fixes that idea.

Things that I will need, I think:

 - Motor  for the front wheel, with appropriate spoke holes for the wheels that I have. 

- Spokes

- switch and controller, and sensor to decide when to use it.

- Battery and charging mechanism.

- and what else? 

What is available in the first? 

https://www.cyclingnews.com/features/best-e-bike-motors/